Advertisement
Bad_Programist

Untitled

Dec 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def tr(x):
  2.     if x == 'write':
  3.         return 'W'
  4.     if x == 'read':
  5.         return 'R'
  6.     if x == 'execute':
  7.         return 'X'
  8. N1 = int(input())
  9. A = {}
  10. S = []
  11. for i in range(N1):
  12.     key, *val = input().split()
  13.     A[key] = val
  14. N2 = int(input())
  15. for i in range(N2):
  16.     v, k = input().split()
  17.     if tr(v) in A[k]:
  18.         S.append('OK')
  19.     else: S.append('Access denied')
  20. for i in S:
  21.     print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement