Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- G = defaultdict(set)
- n, m = map(int, input().split())
- for i in range(m):
- a, b = map(int, input().split())
- G[b].add(a)
- def fun(b, ts):
- ts = set(ts)
- if len(G[b]) > len(ts):
- return False
- if len(G[b].difference( ts ) ):
- return False
- return True
- for i in range(n):
- f1, f2, f3 = map(int, input().split())
- if fun(f3, [f1, f2] ) and fun(f2, [f1]) and fun(f1, []):
- print("honest")
- else:
- print("liar")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement