here is my code and i dont understand where ans goes wrong i think just a minute mistake is thr in this code.
main()
{
int t,n,k=1,r,i,v[10010];
scanf("%d",&t);
while(t--)
{ int j=0,flag=0,r1,r2;
scanf("%d%d",&n,&r);
for(i=0;i<10010;i++){v[i]=0;}
for(i=0;i<r;i++)
{
scanf("%d%d",&r1,&r2);
if(v[r1]==2 || v[r2]==1 || r1==r2)
{
printf("Scenario #%d: spied\n",k);
k++;flag=1;
break;
}
else{ v[r1]=1;v[r2]=2; continue;}
}
if(!flag)
{ printf("Scenario #%d: spying\n",k);k++;}
fflush(stdout);
}
return 0;
}