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> #include<string.h> #define maxn 1000005 int q[maxn],a[maxn],x[maxn],map[maxn]; int main() { int n,i,p=0; while(scanf("%d",&n)!=EOF) { p++; memset(map,0,sizeof(map)); for(i=0;i<n;i++) scanf("%d%d%d",&q[i],&a[i],&x[i]); int sum=0,count=0; for(i=0;i<n;i++) { if(a[i]) { map[q[i]]++; if(map[q[i]]>1) sum+=10; if(x[i]) sum+=40; else sum+=20; } else sum+=10; } printf("Sample Output %d\n",p); printf("%d\n",sum); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator