[백준/파이썬] 25374번 등급 계산하기
-Codegrade = [0, 4, 11, 23, 40, 60, 77, 89, 96, 100, 101]res = [0] * 9n = int(input())points = sorted(list(map(int, input().split())), reverse=True)set_point = sorted(list(set(points)), reverse=True)total, temp, idx = 0, 0, 0for p in set_point: temp += points.count(p) total += points.count(p) if grade[idx + 1]
2024. 6. 14.
[백준/파이썬] 26676번 Wybór zadań
-Codedef solution(n, words): arr = { 1: [0, 0, 0], 2: [0, 0, 0], 3: [0, 0, 0], 4: [0, 0, 0], 5: [0, 0, 0] } for w in words: num, word = int(w[0]), ord(w[1]) - ord('A') arr[num][word] += 1 for el in arr: cut = 1 if el != 5 else 2 for i in range(3): if arr[el][i]
2024. 6. 11.