forked from Ouditchya/SPOJ
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPLE.cpp
More file actions
50 lines (38 loc) · 776 Bytes
/
RPLE.cpp
File metadata and controls
50 lines (38 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// AC , ALGO : STL
/*
Helpful Link : http://www.cplusplus.com/reference/set/set/
*/
// For any clarifications, contact me at : osinha6792@gmail.com
#include<cstdio>
#include<set>
using namespace std ;
int main( )
{
int cs , t , n , r , i , r1 , r2 ;
scanf("%d",&t) ;
for( cs = 1 ; cs <= t ; cs++ )
{
scanf("%d %d",&n,&r) ;
set< int > spy , citizen ;
bool status = true ;
for( i = 0 ; i < r ; i++ )
{
scanf("%d %d",&r1,&r2) ;
spy.insert( r1 ) ;
citizen.insert( r2 ) ;
}
for( i = 0 ; i < n ; i++ )
{
if( spy.count( i ) > 0 && citizen.count( i ) > 0 )
{
status = false ;
break ;
}
}
if( status )
printf("Scenario #%d: spying\n",cs) ;
else
printf("Scenario #%d: spied\n",cs) ;
}
return 0 ;
}