Advertisement
1nikitas

Untitled

Oct 16th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. n, m = map(int, input().split())
  2. d = {}
  3. for x in range(m):
  4.     a, b = map(int, input().split())
  5.     if b in d:
  6.         d[b] += [a]
  7.     else:
  8.         d.update({b: [a]})
  9. for x in range(n):
  10.     liar = False
  11.     k = [int(i) for i in input().split()]
  12.     for i in k:
  13.         if i in d:
  14.             for j in d[i]:
  15.                 if j not in k:
  16.                     liar = True
  17.                     break
  18.                 else:
  19.                     if k.index(j) > k.index(i):
  20.                         liar = True
  21.                         break
  22.     if liar:
  23.         print('liar')
  24.     else:
  25.         print('honest')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement