| ||||||||||
| 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.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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator