Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n, m, a, b, rate[3];
- bool f;
- cin >> n >> m;
- vector <vector <int> > gr(1000010);
- for(int i=0; i<m; i++)
- {
- cin >> a >> b;
- gr[b].push_back(a);
- }
- for (int T = 0; T < n; T++)
- {
- cin >> rate[0] >> rate[1] >> rate[2];
- f = true;
- for (int i=0; f && i<3; i++)
- {
- for (int j : gr[ rate [i] ])
- {
- f = false;
- for (int k=0; !f && k<i; k++)
- if (rate[k] == j)
- f = true;
- if (!f)
- break;
- }
- }
- if (f)
- cout << "honest" << endl;
- else
- cout << "liar" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement