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 |
这是为什么啊,两个一样的,一个ac,一个WA??sort(s,s+i-1); // printf("s[i-1]===%d\n",s[i-1]); num=0; for(j=1;j<i;j++) { for(k=0;k<j;k++) if(s[j]==s[k]*2) num++; } 上面是排序之后找,WA num=0; for(j=0;j<i;j++) { for(k=0;k<i;k++) if(s[j]==s[k]*2) num++; } 上面不排序直接找,AC 两个有什么不同? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator