2525번
비효율의 끝판왕
h, m = map(int, input().split())
t = int(input())
if (t + m) // 60 != 0:
if h + ((t + m) // 60) > 23:
if (t + m) % 60 == 0:
print(h + ((t + m) // 60) - 24, 0)
else:
print(h + ((t + m) // 60) - 24, (t + m) % 60)
else:
if (t + m) % 60 == 0:
print(h + ((t + m) // 60), 0)
else:
print(h + ((t + m) // 60), (t + m) % 60)
else:
print(h, m + t)
시간 시스템을 만들고 나서 바꾼 코드
h, m = map(int, input().split())
t = int(input())
m += t
h += m // 60
m %= 60
h %= 24
print(h, m)
2480번
a,b,c = map(int,input().split())
if a== b== c:
print(a*1000+10000)
elif a!=b==c:
print(b*100+1000)
elif a==b!=c:
print(a*100+1000)
elif a==c!=b:
print(a*100+1000)
else:
print(max(a,b,c)*100)
'코딩 테스트 > Python' 카테고리의 다른 글
| 백준, Python) 심화 1단계 3003, 10988, 1157, 2941, 1316, 25206 (0) | 2025.04.16 |
|---|---|
| 백준, Python) 10809, 2675, 2908, 5622, 11718 (0) | 2025.04.09 |
| 백준, Python) 10870, 10871, 5597 (0) | 2025.04.08 |
| 백준, Python) 15552, 10951 (0) | 2025.04.07 |
| 백준, Python) 1단계 입출력과 사칙연산 (0) | 2025.04.02 |