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> int main() { int num,t,i,z,j,o; int a[35]; freopen("in.txt","r",stdin); scanf("%d",&t); for(z=0;z<t;z++) { j=o=0; scanf("%d",&num); if(num%2==1) { printf("YES\n"); continue; } for(i=0;i<num;i++) { scanf("%d",&a[i]); if(a[i]==1) { if((i+1)%2==1) j++; else o++; } } if(j-o<=1&&j-0>=-1) printf("YES\n"); else printf("NO\n"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator