Advertisement
regergr

Untitled

Nov 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. d = dict()
  2. n = int(input())
  3. for i in range(n):
  4. parts = input().split()
  5. f = parts[0]
  6. l = parts[1:]
  7. d[f] = []
  8. for j in l:
  9. d[f].append(j)
  10. n = int(input())
  11. for i in range(n):
  12. com, f = input().split()
  13. if (com == 'read'):
  14. if ('R' in d[f]):
  15. print('OK')
  16. else:
  17. print('Access denied')
  18. if (com == 'write'):
  19. if ('W' in d[f]):
  20. print('OK')
  21. else:
  22. print('Access denied')
  23. if (com == 'execute'):
  24. if ('X' in d[f]):
  25. print('OK')
  26. else:
  27. print('Access denied')
  28.  
  29.  
  30.  
  31.  
  32.  
  33. d = dict()
  34. n = int(input())
  35. for i in range(n):
  36. parts = input().split()
  37. f = parts[0]
  38. l = parts[1:]
  39. d[f] = []
  40. for j in l:
  41. d[f].append(j)
  42. n = int(input())
  43. for i in range(n):
  44. com, f = input().split()
  45. if (com == 'read'):
  46. if ('R' in d[f]):
  47. print('OK')
  48. else:
  49. print('Access denied')
  50. if (com == 'write'):
  51. if ('W' in d[f]):
  52. print('OK')
  53. else:
  54. print('Access denied')
  55. if (com == 'execute'):
  56. if ('X' in d[f]):
  57. print('OK')
  58. else:
  59. print('Access denied')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement