Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:请问这个程序错在什么地方?

Posted by hhuu at 2007-01-02 21:21:39 on Problem 2419
In Reply To:请问这个程序错在什么地方? Posted by:hhuu at 2007-01-02 21:19:13
```我发现了.
> #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: