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 |
测了N组数据,结果还是没发现错在哪儿..不该啊..#include<iostream> using namespace std; int main() { bool watch[102][102]={{false}}; int set[102]; int p,t; cin>>p>>t; int pp,tt; while(cin>>pp>>tt) { watch[pp][tt]=true; } int setid=1; for(int pe=1;pe<=p;pe++) { bool flag=true; for(int j=1;j<setid;j++) { int i=1; while(i<=t&&watch[pe][i]==watch[j][i]) i++; if(i>t) {flag=false;break;} } if(flag){set[setid++]=pe;} } cout<<setid-1<<endl; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator