Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef pair <ll ,ll> pll;
- typedef pair <int ,int> pii;
- typedef pair <double , double> pt;
- #define pb push_back
- #define eb emplace_back
- #define mp make_pair
- #define prar(a , n) {for (int iiiiiiiiii = 0; iiiiiiiiii < n; iiiiiiiiii++) cout << a[iiiiiiiiii] << ' '; cout << '\n';}
- #define inar(a , n) {for (int iiiiiiiiii = 0; iiiiiiiiii < n; iiiiiiiiii++) cin >> a[iiiiiiiiii];}
- #define prvc(a) {for (int iiiiiiiiii = 0; iiiiiiiiii < a.size(); iiiiiiiiii++) cout << a[iiiiiiiiii] << ' '; cout << '\n';}
- #define invc(a , n) {for (int iiiiiiiiii = 0; iiiiiiiiii < n; iiiiiiiiii++) a.pb(next());}
- #define fi first
- #define se second
- ll next() {ll x; cin >> x; return x;}
- const ll inf = 4e18 , mod = 1e9 + 7;
- const int intf = 1e9 , MaxN = 2e5;
- const double PI = 3.141592653589 , eps = 3;
- int main()
- {
- #ifdef HERE
- freopen("input.txt" , "r" , stdin);
- #else
- //freopen("forest.in" , "r" , stdin); freopen("forest.out" , "w" , stdout);
- ios_base::sync_with_stdio(false);
- #endif
- cout.precision(20);
- int n = next() , m = next();
- vector <unordered_set<int> > a(1e6 + 1);
- for (int i = 0; i < m; i ++){
- int x = next() , y = next();
- a[y].insert(x);
- }
- for (int i = 0; i < n; i ++){
- int x = next() , y = next() , z = next();
- bool ans = true;
- ans &= (a[x].size() == 0);
- ans &= (a[y].size() == 0 || (a[y].size() == 1 && a[y].count(x)));
- ans &= (a[z].size() == 0 || (a[z].size() == 1 && (a[z].count(x) || a[z].count(y))) || (a[z].size() == 2 && (a[z].count(x) && a[z].count(y))));
- if (ans) cout << "honest\n";
- else cout << "liar\n";
- }
- return 0;
- }
- /*
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement