본문 바로가기

백준2352

[백준/파이썬] 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.
[백준/파이썬] 31663번 Mean Words -Coden = int(input())cnts, sums = [0] * 46, [0] * 46for _ in range(n): s = input() for i in range(len(s)): sums[i] += ord(s[i]) cnts[i] += 1res = ""for i in range(46): if cnts[i] == 0: break res += chr(sums[i] // cnts[i])print(res) 2024. 6. 10.