1차 제출. [ 10 / 10 ] PASS
아.. 감격스럽다.. 이 문제 맞춘거
7월인가에 이거랑 비슷한 문제 못 풀어낸 경험 있어서 보자마자 흠칫했다.
괜히 쫄았네 : )
T = int(input())
month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
for tc in range(1, T+1):
month1, date1, month2, date2 = map(int, input().split())
if month1 == month2:
total_dates = date2-date1+1
else:
month1 -= 1
month2 -= 1
total_dates = month[month1] - date1 + 1 + sum(month[month1+1:month2]) + date2
print('#{} {}'.format(tc, total_dates))
'CodingTest > SW Expert Academy' 카테고리의 다른 글
[ SW Expert Academy ] 1966. 숫자를 정렬하자 (0) | 2022.11.15 |
---|---|
[ SW Expert Academy ] 1984. 중간 평균값 구하기 (0) | 2022.11.15 |
[ SW Expert Academy ] 1946. 간단한 압축 풀기 (0) | 2022.11.15 |
[ SW Expert Academy ] 1970. 쉬운 거스름돈 (0) | 2022.11.15 |
[ SW Expert Academy ] 1986. 지그재그 숫자 (0) | 2022.11.15 |