본문 바로가기

백준2379

[백준/파이썬] 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.
[백준/파이썬] 6162번 Superlatives -Codefor t in range(int(input())): e, a = map(int, input().split()) print(f"Data Set {t + 1}:") if e 1: temp /= 5 n += 1 print("mega " * n + "drought") print() 2025. 2. 2.
[백준/파이썬] 33191번 Yalda -Codeprices = [int(input()) for _ in range(4)]my_cost = prices[0]if my_cost >= prices[1]: print("Watermelon")elif my_cost >= prices[2]: print("Pomegranates")elif my_cost >= prices[3]: print("Nuts")else: print("Nothing") 2025. 2. 1.