백준2354 [백준/파이썬] 15083번 Life Savings -Code p1, p2, p3 = sorted(list(map(int, input().split()))) c1, c2, c3 = list(map(int, input().split())) if c2 > c3: c2, c3 = c3, c2 v1 = (p1 + p2 + p3) * c1 / 100 v2 = p2 * c2 / 100 + p3 * c3 / 100 print(f"one {v1:.2f}" if v1 > v2 else f"two {v2:.2f}") 2024. 4. 18. [백준/파이썬] 30544번 Cuckoo! Cuckoo! -Code from math import ceil sound = [15, 30, 45] h, m = map(int, input().split(':')) n = int(input()) if m == 0: n -= h elif m in sound: n -= 1 elif m 0: m += 15 if m == 60: m = 0 h += 1 if h > 12: h -= 12 n -= h else: n -= 1 print(f"{h:02d}:{m:02d}") while로 계산하기 전에 초기값을 셋팅하는 부분에서 잘못 설정한 부분이 많이 발견되서 시간이 좀 걸렸습니다. 2024. 4. 17. [백준/파이썬] 26502번 Decoder -Code replacement = "aeiouy" for _ in range(int(input())): s = input() res = "" for w in s: if w.lower() in replacement: idx = (replacement.find(w.lower()) + 1) % len(replacement) if w.isupper(): res += replacement[idx].upper() else: res += replacement[idx] continue res += w print(res) 2024. 4. 16. [백준/파이썬] 30617번 Knob -Code from sys import stdin arr = [] res = 0 for i in range(int(stdin.readline())): a, b = map(int, stdin.readline().split()) if i > 0: if arr[i - 1][0] == a and arr[i - 1][0] != 0: res += 1 if arr[i - 1][1] == b and arr[i - 1][1] != 0: res += 1 if a == b and a != 0: res += 1 arr.append([a, b]) print(res) 2024. 4. 15. [백준/파이썬] 25965번 미션 도네이션 -Code for _ in range(int(input())): res = 0 mission = [list(map(int, input().split())) for _ in range(int(input()))] my_k, my_d, my_a = map(int, input().split()) for k, d, a in mission: total = my_k * k - my_d * d + my_a * a if total < 0: continue res += total print(res) 2024. 4. 14. [백준/파이썬] 19751번 Fractification -Code a, b, c, d = sorted(list(map(int, input().split()))) print(a, c, b, d) 2024. 4. 13. 이전 1 ··· 48 49 50 51 52 53 54 ··· 393 다음