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

WR in test #1
Posted by mihran 10 Oct 2007 22:49
// PROGRAM 1263 IN C++
# include <iostream.h>
# include <stdio.h>
int main()
{
    int N,M,a[10000];
    double k,l=0;
    cin>>N>>M;
    if (N>=1 && N<=10000 && M>=1 && M<=10000)
    {
        for (int i=0;i<=M-1;i++)
            cin >>a[i];
        for (int p=1;p<=N;p++)
        {
            for (int h=0;h<=M-1;h++)
            {
                if (a[h]==p)
                l++;
            }
            k=(l/M)*100;
            l=0;
            printf ("%.2f",k);
            cout <<'%'<<endl;
        }
    }
    return 0;
}
Re: WR in test #1
Posted by ONU_Qbikkx 7 Oct 2012 21:43

Edited by author 07.10.2012 21:43

Edited by author 07.10.2012 21:44