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 |
Why wrong answer?#include<stdio.h> int data[1000000]; int main() { int m,n,i,j; while(scanf("%d %d",&m,&n)==2){ if(!m && !n) return 0; for(i = 0; i < m*n; i++) scanf("%d",&data[i]); int ni = 0; for(i = 0; i < m*n-1; i++) for(j = i+1; j < m*n; j++) if(data[i] > data[j] && data[j] != 0) ni++; if(ni%2 == 0) printf("YES\n"); else printf("NO\n"); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator