본문 바로가기
반응형

코드 트리13

[문제 풀이 25] 코드 트리 - 특정 조건에 따라 줄 세우기 특정 조건에 따라 줄 세우기 문제 유형 : 정렬, Backtracking사용언어 : Python난이도 : 실버 2출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/line-up-according-to-specific-conditions?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요.www.codetree.ai from itertools import permutations# 소 이름cows = ["Bessie", "Buttercup", "Belind.. 2024. 4. 28.
[문제 풀이 24] 코드 트리 - n x n 표에서의 분배 n x n 표에서의 분배 문제 유형 : DFS 사용언어 : Python 난이도 : 실버 1 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/distribution-in-an-n-x-n-table?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai from collections import deque import sys # 입력 받기 n, L, R = map(int, input().split()) grid = [list(.. 2024. 4. 23.
[문제 풀이 23] 코드 트리 - n x m 표 이동 5 n x m 표 이동 5 문제 유형 : BFS 사용언어 : Python 난이도 : 실버 1 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/move-n-x-m-table-5?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai from collections import deque # 변수 선언 및 입력 받기 n, m = tuple(map(int, input().split())) a = [ list(map(int, input.. 2024. 4. 23.
[문제 풀이 20] 코드 트리 - 연결된 칸 찾기 연결된 칸 찾기 문제 유형 : DFS 사용언어 : Python 난이도 : 실버 1 출처 : 코드 트리 def dfs(grid, visited, x, y, n): stack = [(x, y)] size = 0 # 연결된 1의 개수를 세는 변수 while stack: cx, cy = stack.pop() if visited[cx][cy]: continue visited[cx][cy] = True size += 1 # 상, 하, 좌, 우 네 방향으로 이동 가능 for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]: nx, ny = cx + dx, cy + dy if 0 2024. 4. 19.
[문제 풀이 18] 코드 트리 - 정수 두 개의 합 정수 두 개의 합 문제 유형 : HashMap 사용언어 : Python 난이도 : 실버 4 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/sum-of-two-integers?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai n = int(input()) m = int(input()) arr = list(map(int, input().split())) def count_sort(arr, m): hash_table = .. 2024. 4. 18.
[문제 풀이 15] 코드 트리 - 섞기 전 카드 위치 섞기 전 카드 위치 문제 유형 : Simulation 사용언어 : Python 난이도 : 실버 5 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/card-position-before-shuffling?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai n = int(input()) # Before shuffle location = list(map(int, input().split())) card = list(map(i.. 2024. 4. 17.
[문제 풀이 13] 코드 트리 - 오목의 승패 오목의 승패 문제 유형 : Simulation, BFS 사용언어 : Python 난이도 : 실버 3 출처 : 코드 트리 https://www.codetree.ai/training-field/my-lists/20228/concave-victory-and-defeat/description 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai def bfs(x, y): target = graph[x][y] for dx, dy in direction: cnt = 1 nx = x + dx ny = y + dy while 0 2024. 4. 16.
[문제 풀이 12] 코드 트리 - 색종이 2 색종이 2 문제 유형 : Simulation 사용언어 : Python 난이도 : 실버 5 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/color-paper-2?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai n = int(input()) offset = 200 position = [map(int, input().split()) for _ in range(n)] grid = [[0]*offset for _ in r.. 2024. 4. 15.
[문제 풀이 9] 코드 트리 - 연쇄로 터지는 폭탄 연쇄로 터지는 폭탄 문제 유형 : Simulation, Exhaustive Search 사용언어 : Python 난이도 : 실버 4 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/series-of-bombs-detonating?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai n = int(input()) positions = [int(input()) for _ in range(n)] # 폭탄의 위치 position.. 2024. 4. 12.
[문제 풀이 7] 코드 트리 - 우유 생산량 경쟁 우유 생산량 경쟁 문제 유형 : 정렬, Exhaustive Search 사용언어 : Python 난이도 : 실버 3 출처 : 코드 트리 https://www.codetree.ai/training-field/search/problems/milk-production-competition?&utm_source=clipboard&utm_medium=text 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai n = int(input()) changes = [] for _ in range(n): date, name, change = input().split() d.. 2024. 4. 12.
반응형