Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求救!!!!!!!!

Posted by hdjt at 2006-12-22 10:06:50 on Problem 3138
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator