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 |
请问这个程序错在什么地方?#include <iostream> using namespace std; int main(){ int n[100][100]={0}; int tn,pn,i,j; cin>>pn>>tn; while(cin>>i>>j) { cin.clear(); n[i-1][j-1]=1; } int *hash = new int[pn]; for ( int y=0;y<pn;y++) { hash[y]=0; for ( int x=0;x<tn;x++) hash[y] += (x+1)*n[y][x]; } int rr = 0; for ( int z=0;z<pn;z++) { int flag = 1; for( int mm = 0;mm<z;mm++) { if( hash[mm]==hash[z]) { flag = 0; for( int c=0;c<tn;c++) { if( n[z][c] != n[mm][c]) { flag =1; break; } } } } if ( flag ==1) rr++; } delete []hash; cout<<rr; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator