Solution to BWIDOW
below given code is for bwidow spoj or black widow ring spoj.
below given code is for bwidow spoj or black widow ring spoj.
#includeint main() { int t; scanf("%d",&t); while(t--) { int N,i,j,count=0,flage=0,index; scanf("%d",&N); long r[N],R[N]; for(i=0;i R[j]) count++; else{ flage=0; break; } } } if(count==(N-1)){ flage=1; index=i; break; } } if(flage==1) printf("%d\n",index+1); else printf("-1\n"); } return 0; }
No comments:
Post a Comment
Your comment is valuable to us