PS/BOJ
[백준] 날짜 계산
RUBY_루비
2020. 10. 5. 23:59
출처:: www.acmicpc.net/problem/1476
분류:: 브루트포스
1. 문제 이해 및 해결과정
- 15*28*19의 경우의 수이므로 brute force |
2. 풀이방법
1. [python] brute force
#날짜계산
#https://www.acmicpc.net/problem/1476
import sys
sys.stdin = open("input.txt","r")
E,S,M=map(int,input().split())
x,y,z,year=0,0,0,0
while True:
if x==E and y==S and z==M:
print(year)
exit(0)
x+=1
y+=1
z+=1
year+=1
if x>15:
x=1
if y>28:
y=1
if z>19:
z=1
3. 오답원인
4. 알게된 점