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

请问,我是怎么错的??

Posted by sbs at 2005-04-29 20:21:19 on Problem 1029
#include<iostream.h>
void main()
{
	int a,b,i;
	cin>>a>>b;
	int *t;
	t=new int[a];
	for(i=0;i<a;i++)
		t[i]=0;
	while(b){
		b--;
		int m;
		cin>>m;
		int *n;
		n=new int[2*m];
		for(i=0;i<2*m;i++)
			cin>>n[i];
		char str;
		cin>>str;
		if(str=='=')
			for(i=0;i<2*m;i++)
				t[n[i]-1]=1;//normal
		else if(str=='<')
		{
			for(i=0;i<m;i++)
				if(t[n[i]-1]==0) t[n[i]-1]=-1;//light;
			for(i=m;i<2*m;i++)
				if(t[n[i]-1]==0) t[n[i]-1]=2;//heavy;
		}
		else
		{
				for(i=0;i<m;i++)
				if(t[n[i]-1]==0) t[n[i]-1]=2;//heavy
			for(i=m;i<2*m;i++)
				if(t[n[i]-1]==0) t[n[i]-1]=-1;//light;
		}
	}
	for(i=0;i<a;i++)
		if(t[i]!=1)
			cout<<i+1<<endl;
}



Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator