분류 전체보기293 20250316 회고 보호되어 있는 글 입니다. 2025. 3. 16. [백준/파이썬] #22856 이전에 내가 풀었던 문제더라... 30분의 시간을 두고 풀어보았다. 예제 케이스는 다 맞췄는데 '틀렸습니다'가 떠서 예전 나의 풀이를 참고해보았다. 우선은 30분 동안 시도해 본 풀이는 다음과 같다. import sysfrom typing import Listsys.setrecursionlimit(10**9)class Node: def __init__(self, value, parent, left_child, right_child): self.value: int = value self.parent: Node | None = parent self.left_child: Node | None = left_child self.right_child: Nod.. 2025. 3. 16. [백준/파이썬] #20164 30분 안에 풀지는 못했지만 이전에 시도한 풀이를 가져와봤다. from itertools import combinationsoriginal_number = input()def count_odd_numbers(number: str): odd_count = 0 for num in number: if int(num) % 2 == 1: odd_count += 1 if len(number) == 1: return odd_count, odd_count elif len(number) == 2: new_number = int(number[0]) + int(number[1]) max_count, min_count = count_o.. 2025. 3. 14. [백준/파이썬] #14719 풀이를 봤는데 생각보다 간단한 문제였다... 30분 타임어택으로 못 풀어서 오늘도 풀이를 참고한 다음 풀어봤다. 빗물이 고이는 원리를 생각하면 되는 문제였다. 내 왼쪽의 블럭들 중 가장 높은 지점(left_max)과 내 오른쪽의 블럭들 중 가장 높은 지점(right_max)을 구한 다음, 빗물은 낮은 곳에만 고일 수 있으니 둘의 최솟값을 구해준다. 그러면 적어도 내가 있는 위치 i 에서는 그 값의 차이(min_max - arr[i])만큼은 물이 고일 것이다. H, W = map(int, input().split())arr = list(map(int, input().split()))answer = 0for i in range(1, W-1): left_max = max(arr[:i]) righ.. 2025. 3. 13. [백준/파이썬] #16719 처음에 생각했던 풀이는 다음과 같다. string = input()string_in_answer = [False] * len(string)string_length = len(string)smallest_alphabet = 1e9smallest_alphabet_index = Noneanswer_indexes = []weight = 0for i in range(string_length): smallest_alphabet = 1e9 smallest_alphabet_index = None weight = 0 for j in range(string_length-1, -1, -1): if string_in_answer[j]: weight += 126 .. 2025. 3. 11. [백준/파이썬] #16926 시도했던 풀이는 다음과 같다. N, M, R = map(int, input().split())prev_array = []for _ in range(N): prev_array.append(list(map(int, input().split()))) def get_next_index(row, col): # 몇 번쨰 밖의 사각형에 있는지 파악 circle_radius = 0 for _ in range(R): pass passanswer_array = [[0] * M for _ in range(N)]for i in range(N): for j in range(M): row_index, col_index = get_next_index(i, j) .. 2025. 3. 10. 이전 1 2 3 4 5 6 7 ··· 49 다음