Advertisement
1nikitas

Untitled

Oct 16th, 2019
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. n, m = map(int, input().split())
  2. graph_dic = {}
  3. for x in range(m):
  4.     bol, men = map(int, input().split())
  5.     if men in graph_dic:
  6.         graph_dic[men] += [bol]
  7.     else:
  8.         graph_dic.update({men: [bol]})
  9. for x in range(n):
  10.     liar = False
  11.     love = [int(i) for i in input().split()]
  12.     for film in love:
  13.         if film in graph_dic:
  14.             for film_better in graph_dic[film]:
  15.                 if film_better not in love:
  16.                     liar = True
  17.                     break
  18.                 else:
  19.                     if love.index(film_better) > love.index(film):
  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