-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPLD_Database.cpp
More file actions
40 lines (37 loc) · 1.06 KB
/
RPLD_Database.cpp
File metadata and controls
40 lines (37 loc) · 1.06 KB
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
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
bool cmp(pair<string,int>p1,pair<string,int>p2){
if(p1.second<p2.second)return false;
return true;
}
int main(){
fast;
#ifndef ONLINE_JUDGE
freopen("inputf.in","r",stdin);
freopen("outputf.out","w",stdout);
#endif
//////////////////////////////////
int t,s,n,id,c,sc=1;
std::vector<pair<int,int>> v;
cin>>t;
while(t--){
v.clear();
int flag=0;
cin>>s>>n;
for(int i=0; i<n; i++){cin>>id>>c;v.push_back({id,c});}
sort(v.begin(), v.end());
// for(int i=0; i<n; i++){
// cout<<v[i].first<<' '<<v[i].second<<endl;
// }
for(int i=0; i<n-1; i++){
if(v[i].second==v[i+1].second && v[i].first==v[i+1].first){
flag=1;break;
}
}
if(flag==1)cout<<"Scenario #"<<sc<<": impossible\n";
else cout<<"Scenario #"<<sc<<": possible\n";
sc++;
}
return 0;}