본문 바로가기

백준2347

[백준/파이썬] 30215번 Age Expression -Codedef solution(o, a, k): for i in range(1, o // a + 1): for j in range(1, o // k + 1): if a * i + k * j == o: return True return Falseo, a, k = map(int, input().split())print(1 if solution(o, a, k) else 0) 2024. 6. 16.
[백준/파이썬] 13456번 Richard Hamming -Codefor _ in range(int(input())): n = int(input()) v_list = list(map(int, input().split())) u_list = list(map(int, input().split())) res = 0 for i in range(n): if v_list[i] != u_list[i]: res += 1 print(res) 2024. 6. 15.
[백준/파이썬] 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.
[백준/파이썬] 7360번 Undercut -Codewhile True: n = int(input()) if n == 0: break a_list = list(map(int, input().split())) b_list = list(map(int, input().split())) res_a, res_b = 0, 0 for i in range(n): if abs(a_list[i] - b_list[i]) == 1: if a_list[i] b_list[i]: res_a += a_list[i] elif a_list[i] 2024. 6. 13.
[백준/파이썬] 1269번 대칭 차집합 -Coden1, n2 = map(int, input().split())a_list = set(list(map(int, input().split())))b_list = set(list(map(int, input().split())))print(len(a_list - b_list) + len(b_list - a_list)) 2024. 6. 12.
[백준/파이썬] 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.