Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, m, a, b, rate[3];
  7. bool f;
  8.  
  9. cin >> n >> m;
  10. vector <vector <int> > gr(1000010);
  11.  
  12. for(int i=0; i<m; i++)
  13. {
  14. cin >> a >> b;
  15. gr[b].push_back(a);
  16. }
  17.  
  18. for (int T = 0; T < n; T++)
  19. {
  20. cin >> rate[0] >> rate[1] >> rate[2];
  21. f = true;
  22.  
  23. for (int i=0; f && i<3; i++)
  24. {
  25. for (int j : gr[ rate [i] ])
  26. {
  27.  
  28. f = false;
  29. for (int k=0; !f && k<i; k++)
  30. if (rate[k] == j)
  31. f = true;
  32. if (!f)
  33. break;
  34. }
  35. }
  36.  
  37. if (f)
  38. cout << "honest" << endl;
  39. else
  40. cout << "liar" << endl;
  41. }
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement