1476번 – 날짜 계산

문제

https://www.acmicpc.net/problem/1476

풀이

코드

def check(esm, target):
  return bool(esm[0] == target[0] and esm[1] == target[1] and esm[2] == target[2])

def answer():
  global target, limits
  ans, esm = (1, [1, 1, 1])
  while(check(esm, target) is False):
    ans += 1
    for i in range(3):
      esm[i] = esm[i] + 1
      if esm[i] > limits[i]: esm[i] = 1
  print(ans)
  
  
target = list(map(int, input().split()))
limits = [15, 28, 19]
answer()

Leave a Reply

Your email address will not be published.