알고리즘/백준알고리즘
[백준 알고리즘/Python] 1476 날짜 계산
wonin
2022. 2. 14. 20:43
문제
문제 이해
1 1 1 부터 15 28 19 까지 의 수를 모두 돕니다.
그리고 16, 29, 20 일 때마다 E,S,M을 초기화 시켜주면 됩니다.
코드
E, S, M = map(int,input().split())
count_E = 0
count_S = 0
count_M = 0
for i in range(1,7980+1):
count_E += 1
count_S += 1
count_M += 1
if((count_E % 16) == 0):
count_E = 1
if((count_S % 29) == 0):
count_S = 1
if((count_M % 20) == 0):
count_M = 1
if(count_E == E and count_S == S and count_M == M):
print(i)
break
728x90