Beakjoon&프로그래머스/파이썬2202 [백준/파이썬] 5246번 Virus Outbreak -Codewhile True: dp = [0, 1] t = int(input()) if t == -1: break for _ in range(1, t): dp.append(dp[-1] + dp[-2]) print(f"Hour {t}: {dp[t]} cow(s) affected") 2025. 2. 8. [백준/파이썬] 5246번 Checkerboard Rows -Codefor _ in range(int(input())): p_list = list(map(int, input().split())) column = {} for i in range(1, len(p_list), 2): x, y = p_list[i], p_list[i + 1] if y not in column: column[y] = 1 else: column[y] += 1 print(max(column.values())) 2025. 2. 7. [백준/파이썬] 6856번 Roll the Dice -Codem = int(input())n = int(input())cnt = 0for i in range(1, m + 1): for j in range(1, n + 1): if i + j == 10: cnt += 1if cnt == 1: print("There is 1 way to get the sum 10.")else: print(f"There are {cnt} ways to get the sum 10.") 2025. 2. 6. [백준/파이썬] 9622번 Cabin Baggage -Codecnt = 0for _ in range(int(input())): length, width, depth, weight = map(float, input().split()) if ((length > 56 or width > 45 or depth > 25) and length + width + depth > 125 or weight > 7): print(0) continue cnt += 1 print(1)print(cnt) 2025. 2. 5. [백준/파이썬] 9945번 Centroid of Point Masses -Codet = 0while True: n = int(input()) t += 1 if n 2025. 2. 4. [백준/파이썬] 1213번 팰린드롬 만들기 -Codecount = {}s = input()for el in s: if el in count: count[el] += 1 else: count[el] = 1odd = 0for val in count.values(): if val % 2 == 1: odd += 1 if odd > 1: print("I'm Sorry Hansoo") exit()half = ""middle = ""for key, val in sorted(count.items()): if val % 2 == 1: middle = key if val != 1 and val % 2 == 1: val = val - 1 ha.. 2025. 2. 3. 이전 1 2 3 4 5 6 ··· 367 다음