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 wa? for help !many thanks!!!#include<iostream> using namespace std; int main() { bool flag[100][100]; int i,j,t,p,a,b,k,number[100],sum=0; cin>>p>>t; memset(flag,0,sizeof(flag)); memset(number,0,sizeof(number)); while(cin>>a>>b) if(flag[a][b]==0) { number[a]++; flag[a][b]=1; } bool h; for(i=1;i<=p;i++) for(j=i+1;j<=p;j++) { h=0; if(number[i]==number[j]) { for(k=1;k<=t;k++) { if(flag[i][k]!=flag[j][k]) { h=1; break; } } if(h==0) sum++; } } cout<<p*(p-1)/2-sum<<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