Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include<cstdio>
  2. #include<algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int r,p1[10010],p2[10010],t,n,sol;
  7.  
  8. int main(){
  9.  
  10. sol = 0;
  11.  
  12. scanf("%d",&t);
  13.  
  14. for(int i = 0;i < t;i++){
  15.  
  16. scanf("%d %d",&n ,&r);
  17.  
  18. for(int j = 0;j < r;j++){
  19. scanf("%d %d",&p1[j],p2[j]);
  20. }
  21.  
  22. for(int j = 0;j < r;j++){
  23.  
  24. for(int k = 0;k < r;k++){
  25.  
  26. if(p1[j]==p2[k]){
  27. sol = 1;
  28. }
  29. }
  30. }
  31. if(sol == 1){
  32. printf("Scenario #%d:spied",i);
  33. }
  34. else{
  35. printf("Scenario #%d:spying",i);
  36. }
  37. }
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement