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 08063102 at 2011-07-21 21:34:52 on Problem 3425
#include <stdio.h>
#define m 10005
int main()
{
long a[m];
int i,j,b[m],c[m],n,sum=0,count1=0,count2=0,count3=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%ld %d %d",&a[i],&b[i],&c[i]);
for(j=0;j<i;j++)
{
if(a[j]&&a[j]==a[i]&&b[i])
count1++;
break;
}
if(b[i])
count2++;
if(b[i]&&c[i])
count3++;
}
if(count1>=1)
{
sum=n*10+count1*10+10*count2+count3*20;
}
else
{
sum=n*10+10*count2+20*count3;
}
printf("%d\n",sum);
}


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