본문 바로가기

파이썬2214

[백준/파이썬] 21280번 Förvirrad föreläsare -Coden = int(input())arr = list(map(int, input().split()))now = arr[0]res = [0, 0]for el in arr[1:]: if now > el: res[0] += now - el elif now 2025. 3. 7.
[백준/파이썬] 6436번 Floppies -Codefrom math import ceilt = 0while True: s = int(input()) if s == 0: break t += 1 res = ceil(s / 2) res = ceil(res * 1.5) res = ceil(res / 1860000) print(f"File #{t}") print(f"John needs {res} floppies.") print() 2025. 3. 6.
[백준/파이썬] 20490번 Fermatovi Fakini -Coden = int(input())arr = list(map(int, input().split()))odd, even = [], []for num in arr: if num % 2 == 1: odd.append(num) else: even.append(num)if len(odd) > len(even): odd.sort() for i in range(1, odd[-1] + 3, 2): if i not in odd: print(i) breakelse: even.sort() for i in range(2, even[-1] + 3, 2): if i not in even: .. 2025. 3. 5.
[백준/파이썬] 13670번 Alarme Despertador -Codewhile True: h1, m1, h2, m2 = map(int, input().split()) if h1 == h2 == m1 == m2 == 0: break now = h1 * 60 + m1 next = h2 * 60 + m2 if next 2025. 3. 4.
[백준/파이썬] 20490번 Relocation -Coden, q = map(int, input().split())company_point = [0] + list(map(int, input().split()))for _ in range(q): a, c, x = map(int, input().split()) if a == 1: company_point[c] = x else: print(abs(company_point[c] - company_point[x])) 2025. 3. 3.
[백준/파이썬] 20490번 Рыцарский щит -Codea_list = list(map(int, input().split()))b_list = list(map(int, input().split()))print(sum(a_list + b_list) - 2 * min(max(a_list), max(b_list))) 2025. 3. 2.