Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define watch(x) cout << (#x) << " is " << (x) << endl
- #define pb push_back
- #define pow2(x) ((x)*(x))
- #define max3(a, b, c) max(a, max(b, c))
- #define min3(a, b, c) min(a, min(b, c))
- #define fr(i, n) for(int i = 0; i < int(n); ++i)
- //#define int int64_t
- //#define FIlE_in
- //#define FILE_out
- #ifdef FIlE_in
- char file_in[]="C:\\Users\\pshpi\\OneDrive\\Desktop\\in.cpp";
- #endif // FIlE_in
- #ifdef FILE_out
- char file_out[]="C:\\Users\\pshpi\\OneDrive\\Desktop\\out.cpp";
- #endif // FILE_out
- typedef long long ll;
- const int INF=2e9;
- const ll INF64=1e18;
- const double PI=3.14159265359;
- const double EPS=1e-9;
- const int MOD=1e9+7;
- template<typename type>
- type next()
- {type x;cin>>x;return x;}
- int next()
- {int x;cin>>x;return x;}
- ll lnext()
- {ll x;cin>>x;return x;}
- int main()
- {
- ios::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- #ifdef FIlE_in
- freopen(file_in, "r", stdin);
- #endif // FIlE_in
- #ifdef FILE_out
- freopen(file_out, "w", stdout);
- #endif // FILE_out
- int n=next(), m=next();
- vector<vector<int> > gr(1e6+100);
- for (int i=0; i<m; i++){
- int x=next()-1, y=next()-1;
- gr[y].pb(x);
- }
- for (int i=0; i<n; i++){
- int a=next()-1, b=next()-1, c=next()-1;
- bool fl=false;
- if (gr[a].size()==0){
- if ( (gr[b].size()==1 && gr[b][0]==a) || gr[b].size()==0 ){
- if ( (gr[c].size()==2 && (gr[c][0]==a || gr[c][0]==b) && (gr[c][1]==a || gr[c][1]==b))
- || (gr[c].size()==1 && (gr[c][0]==a || gr[c][0]==b))
- || (gr[c].size()==0)
- )
- fl=true;
- }
- }
- if (fl) cout<<"honest\n";
- else cout<<"liar\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement