Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- for(int i=1;i<=t;i++)
- {
- int n,m;
- cin>>n>>m;
- map<pair<int,int>,int>mp;
- while(m--)
- {
- int a,b;
- cin>>a>>b;
- mp[{a,b}]++;
- }
- int flg=0;
- for(auto u:mp)
- {
- if(u.second>1)
- {
- flg++;
- break;
- }
- }
- if(flg==0) cout<<"Scenario #"<<i<<": possible\n";
- else cout<<"Scenario #"<<i<<": impossible\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement