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

HELP!!!!!
Posted by adilchib 13 Mar 2009 12:02
Do anybody know what is mistake:
#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    vector<int> a,b,count;
    a.resize(m);
    b.resize(n);
    count.resize(n);
    for(int i=0;i<m;i++){
    cin>>a[i];}
    for(int i=0;i<n;i++){
    b[i]=i+1;
    count[i]=0;}
    for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
    if(b[i]==a[j]){
    count[i]++;}}}
    vector<float> c;
    c.resize(n);
    for(int i=0;i<n;i++){
    if(count[i]>0){
    c[i]=m/count[i];
    c[i]=100/c[i];
    cout.precision(2);
    cout<<fixed<<c[i]<<"%"<<endl;}
    else{
    c[i]=count[i];
    cout.precision(2);
    cout<<fixed<<c[i]<<"%"<<endl;}}
    return 0;
}

I got WA#3
Re: HELP!!!!!
Posted by Rockman 17 Mar 2009 13:40
I HAVE WA N12.did you thinked about 0.00% percent
?