SHARE
TWEET

Untitled

a guest Oct 16th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from collections import defaultdict
  2.  
  3. G = defaultdict(set)
  4.  
  5. n, m = map(int, input().split())
  6.  
  7. for _ in range(m):
  8.     a, b = map(int, input().split())
  9.     G[b].add(a)
  10.  
  11. def validateTest(a, b, c):
  12.     _allZeros = lambda key: len(G[key]) == 0
  13.     if not _allZeros(a):
  14.         return False
  15.     if len(G[b] - set((a,))):
  16.         return False
  17.     if len(G[c] - set((a, b))):
  18.         return False
  19.     return True
  20.  
  21. for _ in range(n):
  22.     a, b, c = map(int, input().split())
  23.     print('honest' if validateTest(a, b, c) else 'liar')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top