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 |
求救!!!!!!!!#include<stdio.h> #define pr printf int main() { int i,j,k,n,s,t,m,ip,p,q,count; int sum[101];k=1; while(1) {for(i=1;i<=100;i++) sum[i]=0; count=0; scanf("%d%d%d",&s,&t,&m);if(s+t+m==0) break; for(i=0;i<s;i++) {scanf("%d%d%d",&k,&p,&q); sum[k]+=p+q; count+=sum[k]; } pr("%d\n",count); for(i=1;i<=t;i++) { scanf("%d%d",&j,&n); if(sum[j]<3&&n>=m) {sum[j]++;count++;} } pr("Case %d: %d\n",k,count); k++; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator