| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么会错啊?比赛次数=赢的次数+平局次数,可问什么WA啊?#include<iostream>
#include<algorithm>
using namespace std;
char team[210][20];
int score[210];
int cmp(int a, int b)
{
return a>b;
}
int main()
{
int T, N, num,i;
while(1)
{
scanf("%d%d", &T, &N);
if(!T) break;
for(i=0;i<T;i++)
{
scanf("%s", team[i]);
scanf("%d", &score[i]);
}
sort(score, score+T, cmp);
num=0;
for(i=0;i<T;i++)
{
if(score[i]<3)
break;
num+=score[i]/3;
}
printf("%d\n", N-num);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator