/images/jg_02.jpg

BEAKJOON 1991, 11725, 1967, 1167

​ 1991_트리 순회 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 class Node: def __init__(self, data, L, R): self.data = data self.left = L self.right = R def preorder(node): # 전위 순회 print(node.data, end="") if node.

SW Expert Academy_D4 3143, 10966, 11592, 11545

​ D4_3143_가장 빠른 문자열 타이핑 1 2 3 4 5 6 7 for T in range(int(input())): A, B = input().split() result = len(A) - (A.count(B)*(len(B)-1)) print(f'#{T+1}{result}') # 왜 D4 인가. ​ D4_10966_물놀이를 가자 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 from collections import deque dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] for T in range(int(input())): N, M = map(int, input().

BEAKJOON 15649, 15650

​ 15649_N과 M (1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 N, M = map(int, input().split()) def DFS(count): if count == M: print(*arr) return for i in range(N): if visited[i] == True: continue visited[i] = True arr.append(num_list[i]) DFS(count+1) arr.pop() visited[i] = False num_list = [i + 1 for i in range(N)] visited = [False] * N arr = [] DFS(0) ​

SW Expert Academy_D4 1258, 1249, 1238, 4261

​ D4_1258_행렬찾기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 def check(x, y): dx, dy = 0, 0 while x + dx < N and arr[x+dx][y]: dx += 1 while y + dy < N and arr[x][y+dy]: dy += 1 result.append([dx*dy, dx, dy]) for i in range(x, x+dx): for j in range(y, y+dy): arr[i][j] = 0 for T in range(int(input())): N = int(input()) arr = [list(map(int, input().