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 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator