Advertisement
AllanRocha

Opei 2016

Jul 26th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import sys
  2.  
  3. n = int(input(""))
  4.  
  5. sets = []
  6.  
  7. for x in range(n):
  8.     sets.append([int(m) for m in input("").split()])
  9.  
  10. if n < 3:
  11.     print("em julgamento")
  12. else:
  13.     wins = 0
  14.     lose = 0
  15.  
  16.     for k in range(3):
  17.         a, b = sets[k]
  18.         if abs(a - b) == 1:
  19.             print("em julgamento")
  20.             sys.exit()
  21.         else:
  22.             if a > b:
  23.                 wins += 1
  24.             else:
  25.                 lose += 1
  26.  
  27.     if wins - lose == -3:
  28.         print("culpado")
  29.     elif wins - lose == 0:
  30.         print("inocente")
  31.     else:
  32.         if n == 4:
  33.             a, b = sets[3]
  34.             if a > b + 2:
  35.                 print("inocente")
  36.             elif a + 2 < b:
  37.                 print("culpado")
  38.             else:
  39.                 print("em julgamento")
  40.         else:
  41.             a, b = sets[4]
  42.             if a == b + 2:
  43.                 print("inocente")
  44.             elif a + 2 == b:
  45.                 print("culpado")
  46.             else:
  47.                 print("em julgamento")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement