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 |
还要加上0到目标位置的步数吧。另外这样做不WA也会TLE吧……In Reply To:Why wrong answer? Posted by:ACM06021fly at 2006-07-30 17:43:02 > #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