Forezz

ДЗ 12 Н 3

Aug 4th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. n = int(input())
  2. d = {}
  3. answer = []
  4. for i in range (n):
  5.     a = list(map(str, input().split()))
  6.     d[a[0]] = ""
  7.     for j in range(1, len(a)):
  8.         d[a[0]] += a[j] + " "
  9. m = int(input())
  10. for i in range(m):
  11.     f = list(map(str, input().split()))
  12.     if f[0] in d[f[1]]:
  13.         answer.append("Ok")
  14.     else:
  15.         answer.append("Access denied")
  16. for i in range (len(answer)):
  17.     print(answer[i])
Advertisement
Add Comment
Please, Sign In to add comment