백준2338 [백준/파이썬] 29732번 Rick-Roll Virus -Coden, m, k = map(int, input().split())people = list(input())for i in range(n): if people[i] == 'R': left, right = max(0, i - k), min(n - 1, i + k + 1) for j in range(left, right): people[j] = 'R'print("Yes" if people.count('R') 2024. 7. 25. [백준/파이썬] 9288번 More Dice -Codefor t in range(int(input())): total = int(input()) print(f"Case {t + 1}:") for i in range(1, 7): for j in range(i, 7): if i + j == total: print(f"({i},{j})") 2024. 7. 24. [백준/파이썬] 30143번 Cookie Piles -Codefor _ in range(int(input())): n, a, d = map(int, input().split()) res = [a] for i in range(n - 1): res.append(res[-1] + d) print(sum(res)) 2024. 7. 23. [백준/파이썬] 4758번 Filling Out the Team -Codewhile True: s, w, p = map(float, input().split()) if s == w == p: break res = [] if s = 150 and p >= 200: res.append("Wide Receiver") if s = 300 and p >= 500: res.append("Lineman") if s = 200 and p >= 300: res.append("Quarterback") if len(res) == 0: res.append("No positions") print(*res) 2024. 7. 22. [백준/파이썬] 29534번 Буквы и весы -Coden = int(input())s = input()if len(s) > n: print("Impossible")else: res = 0 for w in s: res += ord(w) - ord('a') + 1 print(res) 2024. 7. 21. [백준/파이썬] 25849번 Briefcases Full of Money -Codemoney = [1, 5, 10, 20, 50, 100]max_money = 0bag = list(map(int, input().split()))res = 0for i in range(6): total = money[i] * bag[i] if total >= max_money: max_money = total res = money[i]print(res) 2024. 7. 20. 이전 1 ··· 29 30 31 32 33 34 35 ··· 390 다음