본문 바로가기
python-algorithm

[백준] 2530

by 무적김두칠 2021. 2. 23.

1
2
3
4
5
6
7
8
9
10
import sys
a,b,c=map(int,sys.stdin.readline().split())
s=int(sys.stdin.readline())
c+=s%60
if c>59: c-=60; b+=1
b+=s//60
if b>59: a+=b//60; b%=60
a+=b//60
if a>23: a%=24
print("%d %d %d"%(a,b,c))
cs

어려운문젠느 아닌데... 미처 생각하지 못한 예외가 있어서 디지털 시계 생각해보시면 쉽게 구현가능합니다

반응형

'python-algorithm' 카테고리의 다른 글

[백준] 2765  (0) 2021.02.25
[백준] 2740  (0) 2021.02.23
[백준] 2163  (0) 2021.02.23
[백준] 2161  (0) 2021.02.23
[백준] 2052  (0) 2021.02.23

댓글