[BOJ] 1476: 날짜 계산

이슬비·2023년 2월 1일
0

Algorithm

목록 보기
66/110
post-thumbnail

허무...해...

1. 다른 풀이

import sys
input = sys.stdin.readline

E, S, M, count = 1, 1, 1, 1
e, s, m = map(int, input().split())

while(True):
    if E==e and S==s and M==m:
        break
    E+=1
    S+=1
    M+=1
    count +=1
    if E>=16: E-=15
    if S>=29: S-=28
    if M>=20: M-=19

print(count)

브루트포스라는 걸 간과하고 너무 어렵게 돌려돌려 생각했다.

2. 마치며

브루트포스는 다 해야한다 !!!
어짜피 다해야해 !!!

profile
정말 알아?

0개의 댓글