ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1263. Elections

WA in test #2 C++
Posted by LasTAD 2 Jul 2016 02:04
#include <iostream>
using namespace std;

int main() {
    int cand, ch;
    cin >> cand >> ch;
    int* Ch = new int[ch];
    double* Cand = new double[cand];

    for (int i = 0; i < cand; i++) {
        Cand[i] = 0;
    }

    for (int i = 0; i < ch; i++)
        cin >> Ch[i];

    for (int i = 0; i < ch; i++) {
            Cand[Ch[i]-1] += 1;
    }

    for (int i = 0; i < cand; i++) {
        printf("%.2f%%\n", (Cand[i]/6.0)*100.0);
    }
}
+++++++++++
Why this isn't work?
Re: WA in test #2 C++
Posted by Vasiliy Kobozev 9 Dec 2016 01:31
What is the hardcoded value "6" in your code?