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 |
这个题目都能tle。。。。。高手帮我看下。。。复杂度是100*500啊#include <iostream> using namespace std; bool flag[105][505]; int main () { int n,d,i,j,ff; scanf("%d%d",&n,&d); while(n!=0&&d!=0) { for(i=1;i<=d;i++) for(j=1;j<=n;j++) scanf("%d",&flag[i][j]); for(i=1;i<=n;i++) { ff=0; for(j=1;j<=d;j++) { if(flag[j][i]==0){ff=1;break;} } if(ff==0)break; } if(ff==0)printf("yes\n"); else printf("no\n"); scanf("%d%d",&n,&d); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator