728x90
반응형
단순하지는 않은 구현(노가다) 문제이다.
from math import ceil, floor
for _ in range(int(input())):
y, m, d = map(int, input().split())
total = now = 0
for i in range(1, 1000):
if i%3 == 0:
total += 20*10
else:
total += (20+19)*5
total += 1
for i in range(1, y):
if i%3 == 0:
now += 20*10
else:
now += (20+19)*5
if y%3 == 0:
now += (m-1)*20 + d
else:
now += ceil((m-1)/2)*20 + floor((m-1)/2)*19 + d
print(total-now)
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 7523번 Gauß(python) (0) | 2021.02.18 |
---|---|
백준 알고리즘 7510번 고급 수학(python) (0) | 2021.02.18 |
백준 알고리즘 6975번 Deficient, Perfect, and Abundant(python) (0) | 2021.02.18 |
백준 알고리즘 6780번 Sumac Sequences(python) (0) | 2021.02.18 |
백준 알고리즘 6794번 What is n, Daddy?(python) (0) | 2021.02.18 |