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 |
My code 交着玩的 ^_^ int main(){int t,n,c,ji,ou,i;scanf("%d",&t);while(t--){scanf("%d",&n);for(i=0,ji=0,ou=0;i<n;i++){scanf("%d",&c);if(c==1){if(i%2==0) ou++;else ji++;}}i=ou-ji;if(n%2){printf("YES\n"In Reply To:大牛们,帮忙呀! 我实在不知道哪里错了 Posted by:caisiren at 2006-03-07 23:09:20 > 如果是奇数,那么一定是‘YES’ > 如果是偶数,则统计在奇数位上和偶数位上白棋的个数,如果他们相差小于2,那么也一定是'YES' > 这难道不对吗? > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator