← Back to List

16581번: Lie Detector ↗

Solutions

Python 3
660 B | 660 chars
import sys
from math import sqrt, pi, sin, factorial, ceil, floor
from datetime import datetime, timedelta
sys.setrecursionlimit(10**7)

BLANK = " "

#inp = input
inp = lambda : sys.stdin.readline().rstrip()
mii = lambda x = BLANK : [*map(int,inp().split(x))]
mfi = lambda x = BLANK : [*map(float,inp().split(x))]
ii = lambda : int(inp())
fi = lambda : float(inp())
p = print


def solve():
  n = ii()
  l = [inp() for _ in range(n)][::-1]

  chk = True
  for i in l:
    if i == "TRUTH":
      continue
    else:
      chk = not chk

  p("TRUTH" if chk else "LIE")
      
if __name__ == "__main__":
  tc = 1

  for t in range(1, tc+1):
    ret = solve()