diff --git "a/H0ngJu/BFS/\354\210\250\353\260\224\352\274\255\354\247\2104.py" "b/H0ngJu/BFS/\354\210\250\353\260\224\352\274\255\354\247\2104.py"
new file mode 100644
index 00000000..d1db02cf
--- /dev/null
+++ "b/H0ngJu/BFS/\354\210\250\353\260\224\352\274\255\354\247\2104.py"
@@ -0,0 +1,33 @@
+import sys
+from collections import deque
+
+def input(): return sys.stdin.readline()
+
+N, K = map(int, input().split())
+
+visited = [0] * 100001
+time = 0
+parent = [-1] * 100001
+
+q = deque([N])
+visited[N] = 1
+
+while q:
+ size = len(q)
+ for _ in range(size):
+ location = q.popleft()
+ if location == K:
+ print(time)
+ answer = []
+ while location != -1:
+ answer.append(location)
+ location = parent[location]
+ answer.reverse()
+ print(" ".join(map(str, answer)))
+ break
+ for next_location in (location + 1, location - 1, location * 2):
+ if 0 <= next_location <= 100000 and not visited[next_location]:
+ q.append(next_location)
+ visited[next_location] = 1
+ parent[next_location] = location
+ time += 1
diff --git a/H0ngJu/DFS/ABCDE.py b/H0ngJu/DFS/ABCDE.py
new file mode 100644
index 00000000..913bdcd3
--- /dev/null
+++ b/H0ngJu/DFS/ABCDE.py
@@ -0,0 +1,43 @@
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+# 재귀함수 fr_check
+def fr_check(friend, stack):
+ stack.append(friend) # 현재 친구를 스택에 추가
+ print(stack)
+
+ if len(stack) == 5: # 친구 5명 되면
+ return stack
+
+ for x in friends[friend]:
+ if x not in stack:
+ result = fr_check(x, stack.copy()) # 복사해야 별도의 stack이 만들어져서 전달 가능
+ if result is not None:
+ return result
+
+ return None # stack이 5가 되지 않은 경우
+
+
+N, M = map(int, input().split())
+friends = [[] for _ in range(N)] #freind[i]에는 i의 친구 담기
+fcheck = 0
+stack = []
+
+
+for _ in range(M):
+ f0, f1 = map(int, input().split())
+ friends[f0].append(f1)
+ friends[f1].append(f0)
+
+
+for idx in range(N):
+ stack = []
+ result = fr_check(idx, stack) #idx부터 체크 시작
+ if result != None and len(result) == 5:
+ fcheck = 1
+ print("1")
+ break
+
+if fcheck == 0:
+ print(0)
\ No newline at end of file
diff --git "a/H0ngJu/DP/1,2,3 \353\215\224\355\225\230\352\270\260.py" "b/H0ngJu/DP/1,2,3 \353\215\224\355\225\230\352\270\260.py"
new file mode 100644
index 00000000..aa703837
--- /dev/null
+++ "b/H0ngJu/DP/1,2,3 \353\215\224\355\225\230\352\270\260.py"
@@ -0,0 +1,26 @@
+import sys
+
+def input(): return sys.stdin.readline().strip()
+
+T = int(input())
+
+answer = []
+dp = [0] * (11)
+
+for index in range(T):
+ data = int(input())
+
+ for i in range(1, data + 1):
+ if i == 1:
+ dp[i] = 1
+ elif i == 2:
+ dp[i] = 2
+ elif i == 3:
+ dp[i] = 4
+ else:
+ dp[i] = dp[i-1] + dp[i-2] + dp[i-3]
+
+ answer.append(dp[data])
+
+for a in answer:
+ print(a, end=" ")
\ No newline at end of file
diff --git "a/H0ngJu/DP/RGB\352\261\260\353\246\254 2.py" "b/H0ngJu/DP/RGB\352\261\260\353\246\254 2.py"
new file mode 100644
index 00000000..3ccfcfe4
--- /dev/null
+++ "b/H0ngJu/DP/RGB\352\261\260\353\246\254 2.py"
@@ -0,0 +1,21 @@
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+N = int(input())
+INF = 1000*1000+1
+
+house = [[int(x) for x in input().split()] for _ in range(N)]
+cost = INF
+
+for first_house in range(3):
+ dp = [[INF] * 3 for _ in range(N)]
+ dp[0][first_house] = house[0][first_house]
+ for i in range(1, N):
+ dp[i][0] = min(dp[i-1][1], dp[i-1][2]) + house[i][0]
+ dp[i][1] = min(dp[i-1][0], dp[i-1][2]) + house[i][1]
+ dp[i][2] = min(dp[i-1][0], dp[i-1][1]) + house[i][2]
+ dp[N-1][first_house] = INF
+ cost = min(cost, min(dp[N-1]))
+
+print(cost)
\ No newline at end of file
diff --git "a/H0ngJu/DP/\354\211\254\354\232\264 \352\263\204\353\213\250 \354\210\230.py" "b/H0ngJu/DP/\354\211\254\354\232\264 \352\263\204\353\213\250 \354\210\230.py"
new file mode 100644
index 00000000..7c5631a2
--- /dev/null
+++ "b/H0ngJu/DP/\354\211\254\354\232\264 \352\263\204\353\213\250 \354\210\230.py"
@@ -0,0 +1,28 @@
+import sys
+
+DIV = 1_000_000_000
+
+N = int(sys.stdin.readline().rstrip())
+
+dp = [[0] * 10 for _ in range(N+1)]
+answer = 0
+
+for i in range(1,N+1):
+ if i == 1:
+ for k in range(1,10):
+ dp[i][k] = 1
+
+ else:
+ for num in range(10):
+ if num == 0:
+ dp[i][num] = dp[i-1][1]%DIV
+ elif num == 9:
+ dp[i][num] = dp[i-1][8]%DIV
+ else:
+ dp[i][num] = (dp[i-1][num-1] + dp[i-1][num+1])%DIV
+
+for k in range(10):
+ answer += dp[N][k]
+
+print(answer%DIV)
+
diff --git a/H0ngJu/README.md b/H0ngJu/README.md
index d01c5315..44f5ff59 100644
--- a/H0ngJu/README.md
+++ b/H0ngJu/README.md
@@ -1,6 +1,19 @@
-## ✏️ 기록
+## ✏️ 기록
+
+| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
+| :----: | :--------: | :------: | :-----------------------------------------------------------------------------------: | :-------------------------------------------------: |
+| 1차시 | 2024.03.05 | 큐 | [프로세스](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 |
+| 2차시 | 2024.03.07 | 큐 | [다리를 지나는 트럭](https://school.programmers.co.kr/learn/courses/30/lessons/42583) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/153 |
+| 3차시 | 2024.03.10 | 힙 | [N번째 큰 수](https://www.acmicpc.net/problem/2075) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/156 |
+| 4차시 | 2024.03.13 | 힙 | [문제집](https://www.acmicpc.net/problem/1766) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/158 |
+| 5차시 | 2024.03.16 | 구현 | [요세푸스 문제](https://www.acmicpc.net/problem/1158) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/161 |
+| 6차시 | 2024.03.19 | 스택 | [오큰수](https://www.acmicpc.net/problem/17298) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/164 |
+| 7차시 | 2024.03.22 | DP | [1,2,3 더하기](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/166 |
+| 8차시 | 2024.03.16 | DP | [쉬운 계단 수](https://www.acmicpc.net/problem/10844) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/170 |
+| 9차시 | 2024.03.22 | DP | [RGB거리 2](https://www.acmicpc.net/problem/17404) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/172 |
+| 10차시 | 2024.04.03 | BFS | [숨바꼭질 4](https://www.acmicpc.net/problem/13913) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/177 |
+| 11차시 | 2024.04.07 | 구현 | [사탕 게임](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/178 |
+| 12차시 | 2024.04.09 | DFS | [ABCDE](https://www.acmicpc.net/problem/13023) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/180 |
+| 13차시 | 2024.05.06 | 완전탐색 | [리모컨](https://www.acmicpc.net/problem/1107) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/181 |
-| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
-|:----:|:---------:|:----:|:-----:|:----:|
-| 1차시 | 2024.03.04 | BFS | 리코쳇 로봇 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/1 |
---
diff --git "a/H0ngJu/\352\265\254\355\230\204/\354\202\254\355\203\225 \352\262\214\354\236\204.py" "b/H0ngJu/\352\265\254\355\230\204/\354\202\254\355\203\225 \352\262\214\354\236\204.py"
new file mode 100644
index 00000000..e2c0a578
--- /dev/null
+++ "b/H0ngJu/\352\265\254\355\230\204/\354\202\254\355\203\225 \352\262\214\354\236\204.py"
@@ -0,0 +1,44 @@
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+def eat(row, col):
+ row_cnt = 0
+ col_cnt = 0
+ tmp_col = 1
+ tmp_row = 1
+ for idx in range(N-1):
+ # 열에서 먹을 때
+ if data[row][idx] == data[row][idx+1]:
+ tmp_col += 1
+ col_cnt = max(col_cnt, tmp_col)
+ else:
+ tmp_col = 1
+
+ # 행에서 먹을 때
+ if data[idx][col] == data[idx+1][col]:
+ tmp_row += 1
+ row_cnt = max(row_cnt, tmp_row)
+ else:
+ tmp_row = 1
+
+ return max(row_cnt, col_cnt)
+
+
+N = int(input())
+data = [[x for x in input()] for _ in range(N)]
+directions = [(0,-1), (0,1), (-1,0),(1,0)]
+cnt = 0
+
+for i in range(N):
+ for k in range(N):
+ for dir in directions:
+ dx, dy = dir
+ x = i+dx
+ y = k+dy
+ if 0<=x")
\ No newline at end of file
diff --git "a/H0ngJu/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py" "b/H0ngJu/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py"
new file mode 100644
index 00000000..a9fbaaee
--- /dev/null
+++ "b/H0ngJu/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py"
@@ -0,0 +1,25 @@
+import sys
+from collections import *
+
+def input(): return sys.stdin.readline().strip()
+N = int(input())
+
+arr = list(map(int, input().split()))
+arr.reverse()
+answer = [-1 for _ in range(N)]
+
+id = 0
+
+stack = []
+stack.append((id,arr.pop()))
+
+while arr:
+ id += 1
+ arr_data = arr.pop()
+ while stack and stack[-1][1] < arr_data:
+ index, data = stack.pop()
+ answer[index] = arr_data
+ stack.append((id, arr_data))
+
+for i in answer:
+ print(i, end=" ")
\ No newline at end of file
diff --git "a/H0ngJu/\354\231\204\354\240\204\355\203\220\354\203\211/\353\246\254\353\252\250\354\273\250.py" "b/H0ngJu/\354\231\204\354\240\204\355\203\220\354\203\211/\353\246\254\353\252\250\354\273\250.py"
new file mode 100644
index 00000000..23afbc12
--- /dev/null
+++ "b/H0ngJu/\354\231\204\354\240\204\355\203\220\354\203\211/\353\246\254\353\252\250\354\273\250.py"
@@ -0,0 +1,22 @@
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+N = int(input())
+M = int(input())
+btn = list(map(int, input().rsplit()))
+
+target = abs(N-100)
+cnt = target
+
+for i in range(1000001):
+ check = True
+ for str_i in str(i):
+ if int(str_i) in btn:
+ check = False
+ break
+
+ if check:
+ cnt = min(cnt, abs(i - N)+len(str(i)))
+
+print(cnt)
\ No newline at end of file
diff --git "a/H0ngJu/\355\201\220/process.py" "b/H0ngJu/\355\201\220/process.py"
new file mode 100644
index 00000000..b966f0a5
--- /dev/null
+++ "b/H0ngJu/\355\201\220/process.py"
@@ -0,0 +1,20 @@
+from collections import deque
+
+def solution(priorities, location):
+ answer = 0
+ queue = deque([(i, k) for k, i in enumerate(priorities)]) # 튜플 큐 생성
+ priorities.sort(reverse=True) # 내림차순 정렬
+
+ while queue:
+ cur = queue.popleft() # 가장 앞의 프로세스 꺼내기 (queue.pop(0))
+ if cur[0] == priorities[0]: # 내림차순으로 정렬된 우선순위 == 현재 순위 -> 가장 높음
+ answer += 1 # 수 ++
+ if cur[1] == location: # 찾고자하는 process인 경우
+ break
+ priorities.pop(0)
+ else:
+ queue.append(cur) # 뒤로 미루기
+
+ return answer
+
+#test
\ No newline at end of file
diff --git "a/H0ngJu/\355\201\220/\353\213\244\353\246\254\353\245\274 \354\247\200\353\202\230\353\212\224 \355\212\270\353\237\255.py" "b/H0ngJu/\355\201\220/\353\213\244\353\246\254\353\245\274 \354\247\200\353\202\230\353\212\224 \355\212\270\353\237\255.py"
new file mode 100644
index 00000000..31404e34
--- /dev/null
+++ "b/H0ngJu/\355\201\220/\353\213\244\353\246\254\353\245\274 \354\247\200\353\202\230\353\212\224 \355\212\270\353\237\255.py"
@@ -0,0 +1,26 @@
+from collections import deque
+
+def solution(bridge_length, weight, truck_weights):
+ time = 0
+ onBridge = deque() # 현재 다리 위에 있는 트럭
+ truckNum = 0 # 현재 다리 위에 있는 트럭 수
+ sum = 0 # 현재 다리 위에 있는 트럭 무게의 합
+ truck_weights = deque(truck_weights)
+
+ while truck_weights or onBridge:
+ time += 1
+
+ # 트럭이 다리를 지나가는 경우 처리
+ if onBridge and time - onBridge[0][1] >= bridge_length:
+ sum -= onBridge.popleft()[0]
+ truckNum -= 1
+
+ # 다음 트럭이 다리에 올라갈 수 있는 경우 처리
+ # 트럭이 있고 합이 weight을 넘지 않으며, 수가 bridge_length를 넘기지 않는 경우
+ if len(truck_weights) != 0 and sum + truck_weights[0] <= weight and truckNum + 1 <= bridge_length:
+ truck = truck_weights.popleft() # pop
+ onBridge.append((truck, time)) # 다리 위의 truck에 tuple 추가
+ sum += truck # 무게 추가
+ truckNum += 1 # 건너고 있는 트럭 추가
+
+ return time
\ No newline at end of file
diff --git "a/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py" "b/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py"
new file mode 100644
index 00000000..5a22ef79
--- /dev/null
+++ "b/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py"
@@ -0,0 +1,19 @@
+import sys
+import heapq
+
+line = int(sys.stdin.readline().strip())
+
+heap = []
+heapq.heapify(heap)
+
+for i in range(line):
+ data = list(map(int, sys.stdin.readline().strip().split()))
+ for s in data:
+ if len(heap) < line:
+ heapq.heappush(heap, s)
+ else:
+ if s > heap[0]:
+ heapq.heappop(heap)
+ heapq.heappush(heap, s)
+
+print(heap[0])
\ No newline at end of file
diff --git "a/H0ngJu/\355\236\231/\353\254\270\354\240\234\354\247\221.py" "b/H0ngJu/\355\236\231/\353\254\270\354\240\234\354\247\221.py"
new file mode 100644
index 00000000..b09a6544
--- /dev/null
+++ "b/H0ngJu/\355\236\231/\353\254\270\354\240\234\354\247\221.py"
@@ -0,0 +1,32 @@
+import sys
+import heapq
+
+n, m = map(int, sys.stdin.readline().rstrip().split())
+
+graph = [[] for _ in range(n+1)]
+inDegree = [0 for _ in range(n+1)]
+q = []
+answer = []
+
+# 입력받아서 넣기
+for _ in range(m):
+ p1, p2 = map(int, sys.stdin.readline().rstrip().split())
+ graph[p1].append(p2) # p1은 p2와 연결된 문제
+ inDegree[p2] += 1 # 간선 추가
+
+# 진입차수가 0이면 큐에 넣기
+for i in range(1, n+1):
+ if inDegree[i] == 0:
+ heapq.heappush(q, i)
+
+# answer에 넣고, 간선 제거
+while q:
+ prob = heapq.heappop(q)
+ answer.append(prob)
+ for i in graph[prob]: # 간선 제거 & 진입차수 0인 것들 처리
+ inDegree[i] -= 1
+ if inDegree[i] == 0:
+ heapq.heappush(q, i)
+
+for result in answer:
+ print(result, end=" ")
\ No newline at end of file
diff --git a/Munbin-Lee/README.md b/Munbin-Lee/README.md
index 79bc19ee..5221cadf 100644
--- a/Munbin-Lee/README.md
+++ b/Munbin-Lee/README.md
@@ -37,4 +37,7 @@
| 34차시 | 2024.02.06 | 구현 | 피자 굽기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/133 |
| 35차시 | 2024.02.18 | 백트래킹 | 단어 마방진 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/140 |
| 36차시 | 2024.02.21 | 문자열 | 회문은 회문아니야!! | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/143 |
+| 37차시 | 2024.03.05 | 백트래킹 | 석유 시추 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/150 |
+| 38차시 | 2024.03.08 | 트라이 | 전화번호 목록 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/155 |
+| 39차시 | 2024.03.14 | 문자열 | 물약 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/160 |
---
diff --git "a/Munbin-Lee/\353\254\270\354\236\220\354\227\264/39-\353\254\274\354\225\275.py" "b/Munbin-Lee/\353\254\270\354\236\220\354\227\264/39-\353\254\274\354\225\275.py"
new file mode 100644
index 00000000..efcfe576
--- /dev/null
+++ "b/Munbin-Lee/\353\254\270\354\236\220\354\227\264/39-\353\254\274\354\225\275.py"
@@ -0,0 +1,45 @@
+stdin = open(0)
+
+def input():
+ return stdin.readline().rstrip()
+
+N, M = map(int, input().split())
+
+prices = {}
+
+for _ in range(N):
+ item, price = input().split()
+ prices[item] = int(price)
+
+recipes = []
+
+for _ in range(M):
+ target, formula = input().split('=')
+ terms = formula.split('+')
+ recipes.append([target, terms])
+
+def updatePrice(target, terms):
+ price = 0
+
+ for term in terms:
+ count = int(term[0])
+ item = term[1:]
+
+ if item not in prices:
+ return
+
+ price += count * prices[item]
+
+ if target not in prices or prices[target] > price:
+ prices[target] = price
+
+for _ in range(M):
+ for recipe in recipes:
+ updatePrice(recipe[0], recipe[1])
+
+if 'LOVE' not in prices:
+ print('-1')
+ exit()
+
+answer = min(prices['LOVE'], 1000000001)
+print(answer)
diff --git "a/Munbin-Lee/\353\260\261\355\212\270\353\236\230\355\202\271/37-\354\204\235\354\234\240 \354\213\234\354\266\224.cpp" "b/Munbin-Lee/\353\260\261\355\212\270\353\236\230\355\202\271/37-\354\204\235\354\234\240 \354\213\234\354\266\224.cpp"
new file mode 100644
index 00000000..b2acdd8a
--- /dev/null
+++ "b/Munbin-Lee/\353\260\261\355\212\270\353\236\230\355\202\271/37-\354\204\235\354\234\240 \354\213\234\354\266\224.cpp"
@@ -0,0 +1,78 @@
+#include
+#include
+#include
+#include
+
+using namespace std;
+
+int solution(vector> land) {
+ int r = land.size();
+ int c = land[0].size();
+
+ int dy[4] {-1, 0, 1, 0};
+ int dx[4] {0, -1, 0, 1};
+
+ vector> chunks(r, vector (c, -1));
+ vector oils;
+
+ auto bfs = [&](int y, int x, int chunk) {
+ queue> q;
+ q.emplace(y, x);
+
+ int oil = 0;
+
+ while (!q.empty()) {
+ auto [cy, cx] = q.front();
+ q.pop();
+
+ oil++;
+ chunks[cy][cx] = chunk;
+
+ for (int dir = 0; dir < 4; dir++) {
+ int ny = cy + dy[dir];
+ int nx = cx + dx[dir];
+
+ if (ny == -1 || ny == r || nx == -1 || nx == c) continue;
+ if (land[ny][nx] == 0) continue;
+
+ land[ny][nx] = 0;
+ q.emplace(ny, nx);
+ }
+ }
+
+ oils.emplace_back(oil);
+ };
+
+ for (int y = 0; y < r; y++) {
+ for (int x = 0; x < c; x++) {
+ if (land[y][x] == 0) continue;
+
+ land[y][x] = 0;
+ bfs(y, x, oils.size());
+ }
+ }
+
+ int answer = -1;
+
+ for (int x = 0; x < c; x++) {
+ unordered_set set;
+
+ for (int y = 0; y < r; y++) {
+ int chunk = chunks[y][x];
+
+ if (chunk == -1) continue;
+
+ set.emplace(chunk);
+ }
+
+ int oil = 0;
+
+ for (int chunk : set) {
+ oil += oils[chunk];
+ }
+
+ answer = max(answer, oil);
+ }
+
+ return answer;
+}
diff --git "a/Munbin-Lee/\355\212\270\353\246\254/38-\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235.cpp" "b/Munbin-Lee/\355\212\270\353\246\254/38-\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235.cpp"
new file mode 100644
index 00000000..5e5033f9
--- /dev/null
+++ "b/Munbin-Lee/\355\212\270\353\246\254/38-\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235.cpp"
@@ -0,0 +1,80 @@
+#include
+#include
+
+using namespace std;
+
+struct Trie {
+ struct Node {
+ Node *children[10]{};
+ bool isTerminal = false;
+ };
+
+ Node *root = new Node;
+
+ bool insert(string &s) const {
+ auto cur = root;
+
+ for (char ch: s) {
+ int digit = ch - '0';
+
+ if (!cur->children[digit]) {
+ cur->children[digit] = new Node();
+ cur = cur->children[digit];
+ continue;
+ }
+
+ if (cur->children[digit]->isTerminal) {
+ return false;
+ }
+
+ cur = cur->children[digit];
+ }
+
+ for (auto child: cur->children) {
+ if (child) {
+ return false;
+ }
+ }
+
+ cur->isTerminal = true;
+
+ return true;
+ }
+};
+
+int main() {
+ ios_base::sync_with_stdio(false);
+ cin.tie(nullptr);
+
+ auto solve = []() {
+ auto trie = new Trie;
+
+ int n;
+ cin >> n;
+
+ vector numbers(n);
+
+ for (auto &number: numbers) {
+ cin >> number;
+ }
+
+ for (auto number: numbers) {
+ if (!trie->insert(number)) {
+ cout << "NO\n";
+ delete trie;
+ return;
+ }
+ }
+
+ cout << "YES\n";
+ };
+
+ int t;
+ cin >> t;
+
+ while (t--) {
+ solve();
+ }
+
+ return 0;
+}
diff --git "a/pknujsp/BFS/42-\353\213\244\353\246\254 \353\247\214\353\223\244\352\270\260.py" "b/pknujsp/BFS/42-\353\213\244\353\246\254 \353\247\214\353\223\244\352\270\260.py"
new file mode 100644
index 00000000..478f5364
--- /dev/null
+++ "b/pknujsp/BFS/42-\353\213\244\353\246\254 \353\247\214\353\223\244\352\270\260.py"
@@ -0,0 +1,73 @@
+from collections import *
+
+map_size = int(input())
+matrix = [list(map(int, input().split())) for _ in range(map_size)]
+
+directions = [(1, 0), (0, -1), (-1, 0), (0, 1)]
+island_id = 2
+costs = [[0] * map_size for _ in range(map_size)]
+
+# 다리를 놓을 위치를 저장할 큐
+bridge_queue = deque()
+
+# 전체 맵을 순회하면서 각 섬에 ID 부여
+for row in range(map_size):
+ for col in range(map_size):
+
+ if matrix[row][col] != 1:
+ continue
+
+ # 현재 칸을 시작으로 하는 섬에 고유 ID 할당
+ matrix[row][col] = island_id
+ queue = deque([(row, col)])
+
+ # BFS를 통해 같은 섬인 육지에 ID 할당
+ while queue:
+ r, c = queue.popleft()
+ for dr, dc in directions:
+ nr, nc = r + dr, c + dc
+
+ if not 0 <= nr < map_size or not 0 <= nc < map_size:
+ continue
+
+ # 다른 섬과 연결된 바다 영역에 접근하면 종료
+ if 1 < matrix[nr][nc] < island_id:
+ print(1)
+ exit()
+
+ # 새로운 육지 발견 시 큐에 추가
+ if matrix[nr][nc] == 1:
+ queue.append((nr, nc))
+ # 육지와 바로 맞닿은 바다 영역을 다리 후보로 추가
+ elif matrix[nr][nc] == costs[nr][nc] == 0:
+ bridge_queue.append((nr, nc, 1, island_id))
+
+ costs[nr][nc] = 1
+ matrix[nr][nc] = island_id
+
+ island_id += 1
+
+min_cost = int(1e6)
+
+# 다리 후보 위치를 순회하며 최소 다리 길이 계산
+while bridge_queue:
+ r, c, cost, curr_island_id = bridge_queue.popleft()
+
+ for dr, dc in directions:
+ nr, nc = r + dr, c + dc
+
+ if not 0 <= nr < map_size or not 0 <= nc < map_size:
+ continue
+
+ # 아직 다리가 놓이지 않은 바다 영역이면
+ # 다리 길이를 증가시키고 큐에 추가
+ if costs[nr][nc] == 0:
+ bridge_queue.append((nr, nc, cost + 1, curr_island_id))
+
+ costs[nr][nc] = cost + 1
+ matrix[nr][nc] = curr_island_id
+ # 다른 섬과 연결된 다리 영역에 접근하였다면 최소 비용을 갱신
+ elif matrix[nr][nc] > 1 and matrix[nr][nc] != curr_island_id:
+ min_cost = min(min_cost, cost + costs[nr][nc])
+
+print(min_cost)
\ No newline at end of file
diff --git "a/pknujsp/BRUTE_FORCE/38-\354\236\220\353\254\274\354\207\240\354\231\200 \354\227\264\354\207\240.py" "b/pknujsp/BRUTE_FORCE/38-\354\236\220\353\254\274\354\207\240\354\231\200 \354\227\264\354\207\240.py"
new file mode 100644
index 00000000..e1cc927a
--- /dev/null
+++ "b/pknujsp/BRUTE_FORCE/38-\354\236\220\353\254\274\354\207\240\354\231\200 \354\227\264\354\207\240.py"
@@ -0,0 +1,50 @@
+# 자물쇠의 중간 부분이 모두 1인지 확인
+def is_valid(new_lock):
+ length = len(new_lock) // 3
+
+ for r in range(length, length * 2):
+ for c in range(length, length * 2):
+ if new_lock[r][c] != 1:
+ return False
+
+ return True
+
+def solution(key, lock):
+ n = len(lock)
+ k = len(key)
+ new_lock = [[0] * (n * 3) for _ in range(n * 3)]
+
+ for r in range(n):
+ for c in range(n):
+ new_lock[r + n][c + n] = lock[r][c]
+
+ for _ in range(4):
+ rev_key = key[::-1]
+ key = []
+ for c in range(k):
+ row = []
+ for r in range(k):
+ row.append(rev_key[r][c])
+ key.append(row)
+
+ """
+ 열쇠를 돌리는 로직은 한 줄로도 구현가능 합니다
+ key = [row for row in zip(*reversed(key))]
+ """
+
+ for r in range(n * 2):
+ for c in range(n * 2):
+ # 자물쇠에 열쇠를 끼운다
+ for i in range(k):
+ for j in range(k):
+ new_lock[r + i][c + j] += key[i][j]
+
+ # 자물쇠에 열쇠가 딱 들어갔는지 확인
+ if is_valid(new_lock):
+ return True
+
+ # 자물쇠에서 열쇠를 빼서 복구시킨다
+ for i in range(k):
+ for j in range(k):
+ new_lock[r + i][c + j] -= key[i][j]
+ return False
\ No newline at end of file
diff --git a/pknujsp/README.md b/pknujsp/README.md
index ab833635..489d3d88 100644
--- a/pknujsp/README.md
+++ b/pknujsp/README.md
@@ -1,26 +1,26 @@
## ✏️ 기록
-| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
-| :----: | :--------: | :-------------: | :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------: |
-| 1차시 | 2023.10.07 | BRUTE_FORCE | [BOJ_1107](https://www.acmicpc.net/problem/1107) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/2) |
-| 2차시 | 2023.10.09 | BRUTE_FORCE | [연속 부분 수열 합의 개수](https://school.programmers.co.kr/learn/courses/30/lessons/131701) | [#5](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/5) |
-| 3차시 | 2023.10.11 | SORT | [최솟값 만들기](https://school.programmers.co.kr/learn/courses/30/lessons/12941?language=python3) | [#8](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/8) |
-| 4차시 | 2023.10.13 | SORT | [튜플](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/9) |
-| 5차시 | 2023.10.15 | 구현 | [괄호 변환](https://school.programmers.co.kr/learn/courses/30/lessons/60058) | [#13](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/13) |
-| 6차시 | 2023.10.17 | 탐색 | [쿼드압축 후 개수 세기](https://school.programmers.co.kr/learn/courses/30/lessons/68936) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/16) |
-| 7차시 | 2023.10.19 | 탐색 | [무인도 여행](https://school.programmers.co.kr/learn/courses/30/lessons/154540) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/20) |
-| 8차시 | 2023.10.21 | 탐색 | [거리두기 확인하기](https://school.programmers.co.kr/learn/courses/30/lessons/81302) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/22) |
-| 9차시 | 2023.10.23 | 맵 | [스킬 트리](https://school.programmers.co.kr/learn/courses/30/lessons/49993) | [#25](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/25) |
-| 10차시 | 2023.10.25 | 구현 | [수식 최대화](https://school.programmers.co.kr/learn/courses/30/lessons/67257) | [#28](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/28) |
-| 11차시 | 2023.10.27 | 리스트 | [영어 끝말잇기](https://school.programmers.co.kr/learn/courses/30/lessons/12981) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/30) |
-| 12차시 | 2023.10.30 | 큐 | [이중우선순위큐](https://school.programmers.co.kr/learn/courses/30/lessons/42628) | [#36](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/36) |
-| 13차시 | 2023.11.01 | DP | [등굣길](https://school.programmers.co.kr/learn/courses/30/lessons/42898) | [#39](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/39) |
-| 14차시 | 2023.11.03 | 맵 | [시소 짝꿍](https://school.programmers.co.kr/learn/courses/30/lessons/152996) | [#43](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/43) |
-| 15차시 | 2023.11.05 | 수학 | [예상 대진표](https://school.programmers.co.kr/learn/courses/30/lessons/12985) | [#47](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/47) |
-| 16차시 | 2023.11.08 | 수학 | [숫자 변환하기](https://school.programmers.co.kr/learn/courses/30/lessons/154538) | [#51](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/51) |
-| 17차시 | 2023.11.10 | 스택 | [짝지어 제거하기](https://school.programmers.co.kr/learn/courses/30/lessons/12973) | [#54](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/54) |
-| 18차시 | 2023.11.13 | 구현 | [키패드 누르기](https://school.programmers.co.kr/learn/courses/30/lessons/67256) | [#60](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/60) |
-| 19차시 | 2023.11.17 | 구현 | [실패율](https://school.programmers.co.kr/learn/courses/30/lessons/42889) | [#64](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/64) |
+| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
+| :----: | :--------: | :-------------: | :-----------------------------------------------------------------------------------------------: | :---------------------------------------------------------: |
+| 1차시 | 2023.10.07 | BRUTE_FORCE | [BOJ_1107](https://www.acmicpc.net/problem/1107) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/2) |
+| 2차시 | 2023.10.09 | BRUTE_FORCE | [연속 부분 수열 합의 개수](https://school.programmers.co.kr/learn/courses/30/lessons/131701) | [#5](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/5) |
+| 3차시 | 2023.10.11 | SORT | [최솟값 만들기](https://school.programmers.co.kr/learn/courses/30/lessons/12941?language=python3) | [#8](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/8) |
+| 4차시 | 2023.10.13 | SORT | [튜플](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/9) |
+| 5차시 | 2023.10.15 | 구현 | [괄호 변환](https://school.programmers.co.kr/learn/courses/30/lessons/60058) | [#13](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/13) |
+| 6차시 | 2023.10.17 | 탐색 | [쿼드압축 후 개수 세기](https://school.programmers.co.kr/learn/courses/30/lessons/68936) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/16) |
+| 7차시 | 2023.10.19 | 탐색 | [무인도 여행](https://school.programmers.co.kr/learn/courses/30/lessons/154540) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/20) |
+| 8차시 | 2023.10.21 | 탐색 | [거리두기 확인하기](https://school.programmers.co.kr/learn/courses/30/lessons/81302) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/22) |
+| 9차시 | 2023.10.23 | 맵 | [스킬 트리](https://school.programmers.co.kr/learn/courses/30/lessons/49993) | [#25](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/25) |
+| 10차시 | 2023.10.25 | 구현 | [수식 최대화](https://school.programmers.co.kr/learn/courses/30/lessons/67257) | [#28](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/28) |
+| 11차시 | 2023.10.27 | 리스트 | [영어 끝말잇기](https://school.programmers.co.kr/learn/courses/30/lessons/12981) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/30) |
+| 12차시 | 2023.10.30 | 큐 | [이중우선순위큐](https://school.programmers.co.kr/learn/courses/30/lessons/42628) | [#36](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/36) |
+| 13차시 | 2023.11.01 | DP | [등굣길](https://school.programmers.co.kr/learn/courses/30/lessons/42898) | [#39](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/39) |
+| 14차시 | 2023.11.03 | 맵 | [시소 짝꿍](https://school.programmers.co.kr/learn/courses/30/lessons/152996) | [#43](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/43) |
+| 15차시 | 2023.11.05 | 수학 | [예상 대진표](https://school.programmers.co.kr/learn/courses/30/lessons/12985) | [#47](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/47) |
+| 16차시 | 2023.11.08 | 수학 | [숫자 변환하기](https://school.programmers.co.kr/learn/courses/30/lessons/154538) | [#51](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/51) |
+| 17차시 | 2023.11.10 | 스택 | [짝지어 제거하기](https://school.programmers.co.kr/learn/courses/30/lessons/12973) | [#54](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/54) |
+| 18차시 | 2023.11.13 | 구현 | [키패드 누르기](https://school.programmers.co.kr/learn/courses/30/lessons/67256) | [#60](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/60) |
+| 19차시 | 2023.11.17 | 구현 | [실패율](https://school.programmers.co.kr/learn/courses/30/lessons/42889) | [#64](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/64) |
| 20차시 | 2023.11.20 | 문자열 | [옹알이 (2)](https://school.programmers.co.kr/learn/courses/30/lessons/133499) | [#70](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/70) |
| 21차시 | 2023.11.23 | 맵 | [의상](https://school.programmers.co.kr/learn/courses/30/lessons/42578) | [#73](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/73) |
| 22차시 | 2023.11.26 | 그리디 | [구명보트](https://school.programmers.co.kr/learn/courses/30/lessons/42885) | [#79](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/79) |
@@ -37,4 +37,11 @@
| 33차시 | 2024.02.06 | 큐 | [철로](https://www.acmicpc.net/problem/13334) | [#132](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/132) |
| 34차시 | 2024.02.12 | BFS | [이분 그래프](https://www.acmicpc.net/problem/1707) | [#135](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/135) |
| 35차시 | 2024.02.18 | 그리디 | [선물할인](https://www.acmicpc.net/problem/25947) | [#137](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/137) |
-| 36차시 | 2024.02.21 | 이진탐색 | [휴게소 세우기](https://www.acmicpc.net/problem/1477) | [#143](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/143) |
\ No newline at end of file
+| 36차시 | 2024.02.21 | 이진탐색 | [휴게소 세우기](https://www.acmicpc.net/problem/1477) | [#143](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/143) |
+| 37차시 | 2024.03.04 | 구현 | [n+1 카드게임](https://school.programmers.co.kr/learn/courses/30/lessons/258707) | [#149](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/149) |
+| 38차시 | 2024.03.08 | BRUTE_FORCE | [자물쇠와 열쇠](https://school.programmers.co.kr/learn/courses/30/lessons/60059) | [#154](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/154) |
+| 39차시 | 2024.03.19 | 큐 | [디스크 컨트롤러](https://school.programmers.co.kr/learn/courses/30/lessons/42627) | [#163](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/163) |
+| 40차시 | 2024.03.22 | 그리디 | [센서](https://www.acmicpc.net/problem/2212) | [#168](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/168) |
+| 41차시 | 2024.03.25 | 다익스트라 | [알고스팟](https://www.acmicpc.net/problem/1261) | [#169](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/169) |
+| 42차시 | 2024.03.29 | BFS | [다리 만들기](https://www.acmicpc.net/problem/2146) | [#173](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/173) |
+| 43차시 | 2024.04.03 | 그리디 | [저울](https://www.acmicpc.net/problem/2437) | [#175](https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/175) |
\ No newline at end of file
diff --git "a/pknujsp/\352\265\254\355\230\204/37-\354\271\264\353\223\234\352\262\214\354\236\204.py" "b/pknujsp/\352\265\254\355\230\204/37-\354\271\264\353\223\234\352\262\214\354\236\204.py"
new file mode 100644
index 00000000..6f1f8396
--- /dev/null
+++ "b/pknujsp/\352\265\254\355\230\204/37-\354\271\264\353\223\234\352\262\214\354\236\204.py"
@@ -0,0 +1,53 @@
+def solution(coin, cards):
+ a = set(cards[:len(cards) // 3])
+ b = set()
+ t = len(cards) + 1
+ r = 1
+
+ for i in range(len(cards) // 3 + 1, len(cards), 2):
+ c1, c2 = cards[i - 1], cards[i]
+ b.add(c1)
+ b.add(c2)
+
+ removed = False
+ # 현재 가지고 있는 카드 목록 중 n + 1이 가능한 경우 확인
+ for x in list(a):
+ if t - x in a:
+ a.remove(t - x)
+ a.remove(x)
+ removed = True
+ break
+
+ if removed:
+ r += 1
+ continue
+
+ # 코인으로 교환해서 얻을 수 있는 카드 중에서 n + 1이 되는 경우를 찾아야 함
+ # 코인이 없으므로 종료
+ if not coin:
+ break
+
+ # `현재 갖고 있는 카드 + 얻을 수 있는 카드` = n + 1이 되는 경우를 확인
+ for x in list(b):
+ if t - x in a:
+ a.remove(t - x)
+ b.remove(x)
+ removed = True
+ coin -= 1
+ break
+ # 마지막 방법으로, 오직 교환으로 얻을 수 있는 카드 목록 중에서 n + 1이 되는 경우를 확인
+ if not removed and coin >= 2:
+ for x in list(b):
+ if t - x in b:
+ b.remove(t - x)
+ b.remove(x)
+ removed = True
+ coin -= 2
+ break
+
+ # n + 1을 어떤 경우에도 못 만들면 종료
+ if not removed:
+ break
+ r += 1
+
+ return r
\ No newline at end of file
diff --git "a/pknujsp/\352\267\270\353\246\254\353\224\224/40-\354\204\274\354\204\234.py" "b/pknujsp/\352\267\270\353\246\254\353\224\224/40-\354\204\274\354\204\234.py"
new file mode 100644
index 00000000..07494620
--- /dev/null
+++ "b/pknujsp/\352\267\270\353\246\254\353\224\224/40-\354\204\274\354\204\234.py"
@@ -0,0 +1,18 @@
+from sys import *
+
+N = int(stdin.readline())
+K = int(stdin.readline())
+SENSORS = sorted(set(map(int, stdin.readline().split())))
+
+if K >= N:
+ print(0)
+ exit()
+
+distances = [SENSORS[i] - SENSORS[i - 1] for i in range(1, len(SENSORS))]
+distances.sort(reverse=True)
+
+result = 0
+for i in range(K - 1, len(distances)):
+ result += distances[i]
+
+print(result)
diff --git "a/pknujsp/\352\267\270\353\246\254\353\224\224/43-\354\240\200\354\232\270.py" "b/pknujsp/\352\267\270\353\246\254\353\224\224/43-\354\240\200\354\232\270.py"
new file mode 100644
index 00000000..8000dc85
--- /dev/null
+++ "b/pknujsp/\352\267\270\353\246\254\353\224\224/43-\354\240\200\354\232\270.py"
@@ -0,0 +1,13 @@
+N = int(input())
+weights = list(map(int, input().split()))
+weights.sort()
+
+x = 0
+for weight in weights:
+ # x + 1이 현재 추의 무게보다 작다면, 측정이 불가능함
+ if x + 1 < weight:
+ break
+
+ x += weight
+
+print(x + 1)
\ No newline at end of file
diff --git "a/pknujsp/\353\213\244\354\235\265\354\212\244\355\212\270\353\235\274/41-\354\225\214\352\263\240\354\212\244\355\214\237.py" "b/pknujsp/\353\213\244\354\235\265\354\212\244\355\212\270\353\235\274/41-\354\225\214\352\263\240\354\212\244\355\214\237.py"
new file mode 100644
index 00000000..364af0a3
--- /dev/null
+++ "b/pknujsp/\353\213\244\354\235\265\354\212\244\355\212\270\353\235\274/41-\354\225\214\352\263\240\354\212\244\355\214\237.py"
@@ -0,0 +1,33 @@
+from heapq import *
+from sys import *
+
+C, R = map(int, stdin.readline().split())
+arr = [list(map(int, list(stdin.readline().strip()))) for _ in range(R)]
+
+drc = ((1,0),(-1,0),(0,1),(0,-1))
+visited = [[False] * C for _ in range(R)]
+heap = [(0, 0, 0)]
+target_r = R - 1
+target_c = C - 1
+
+while heap:
+ cost, r, c = heappop(heap)
+
+ if r == target_r and c == target_c:
+ print(cost)
+ break
+ if visited[r][c]:
+ continue
+
+ visited[r][c] = True
+
+ for dr, dc in drc:
+ nr = r + dr
+ nc = c + dc
+
+ if not 0 <= nr < R or not 0 <= nc < C:
+ continue
+ if visited[nr][nc]:
+ continue
+
+ heappush(heap, (cost + arr[nr][nc], nr, nc))
diff --git "a/pknujsp/\355\201\220/39-\353\224\224\354\212\244\355\201\254 \354\273\250\355\212\270\353\241\244\353\237\254.py" "b/pknujsp/\355\201\220/39-\353\224\224\354\212\244\355\201\254 \354\273\250\355\212\270\353\241\244\353\237\254.py"
new file mode 100644
index 00000000..0a0b4d8e
--- /dev/null
+++ "b/pknujsp/\355\201\220/39-\353\224\224\354\212\244\355\201\254 \354\273\250\355\212\270\353\241\244\353\237\254.py"
@@ -0,0 +1,24 @@
+from heapq import *
+from collections import *
+
+def solution(jobs):
+ jobs = deque(sorted(jobs))
+ jobs_num = len(jobs)
+
+ curr_time = wait_time = 0
+ heap = []
+
+ while heap or jobs:
+ while jobs and jobs[0][0] <= curr_time:
+ requested_time, duration = jobs.popleft()
+ heappush(heap, (duration, requested_time))
+
+ if heap:
+ duration, requested_time = heappop(heap)
+
+ curr_time += duration
+ wait_time += curr_time - requested_time
+ else:
+ curr_time += 1
+
+ return wait_time // jobs_num
\ No newline at end of file
diff --git "a/tgyuuAn/BFS/\352\263\274\354\231\270\353\247\250.py" "b/tgyuuAn/BFS/\352\263\274\354\231\270\353\247\250.py"
new file mode 100644
index 00000000..e69de29b
diff --git "a/tgyuuAn/BFS/\354\227\264\354\207\240.py" "b/tgyuuAn/BFS/\354\227\264\354\207\240.py"
new file mode 100644
index 00000000..36494506
--- /dev/null
+++ "b/tgyuuAn/BFS/\354\227\264\354\207\240.py"
@@ -0,0 +1,97 @@
+import sys
+from collections import deque, defaultdict
+
+def input(): return sys.stdin.readline().rstrip()
+
+dx = [0, 0, -1, 1]
+dy = [-1, 1, 0, 0]
+
+T = int(input())
+
+for _ in range(T):
+
+ H, W = map(int, input().split())
+ building = [["." for _ in range(W+2)]]
+ door_info = defaultdict(set)
+ keys_i_have = set()
+
+ for row in range(H):
+ _input = "."
+ _input += input()
+ _input += "."
+
+ for col in range(W+2):
+ if _input[col] not in ("*", ".", "$") and _input[col].isupper():
+ door_info[_input[col]].add((row+1, col))
+
+ building.append(list(_input))
+
+ building.append(["." for _ in range(W+2)])
+
+ keys_info = input()
+ if keys_info != "0":
+ keys_i_have.update(set(keys_info))
+
+ answer = 0
+ visited = set()
+ locked_doors_to_access = set()
+
+ deq = deque([(0, 0)])
+ while deq:
+ now_row, now_col = deq.popleft()
+
+ for dir in range(4):
+ new_row = now_row + dy[dir]
+ new_col = now_col + dx[dir]
+
+ if new_row < 0 or new_row >= H+2: continue
+ if new_col < 0 or new_col >= W+2: continue
+ if (new_row, new_col) in visited: continue
+ if building[new_row][new_col] == "*": continue
+
+ # print(now_row, now_col,building[new_row][new_col])
+ # print(locked_doors_to_access)
+ # print(keys_i_have)
+ # print()
+
+ if building[new_row][new_col] == "$":
+ answer += 1
+ visited.add((new_row, new_col))
+ deq.append((new_row, new_col))
+ continue
+
+ # 문을 만났을 경우, 이 때 까지 얻은 열쇠로 열 수 있는 지 확인함. 아닐 경우 접근할 수 있는 문 목록에 추가
+ if building[new_row][new_col].isalpha() and building[new_row][new_col].isupper():
+
+ # 열쇠를 이미 가지고 있는 경우
+ if building[new_row][new_col].lower() in keys_i_have:
+ building[new_row][new_col] = "."
+ visited.add((new_row, new_col))
+ deq.append((new_row, new_col))
+
+ # 열쇠가 없어서 문을 못 열 경우 접근할 수 있는 문 목록에 추가
+ else: locked_doors_to_access.add((new_row, new_col))
+
+ continue
+
+ # 열쇠를 획득했을 경우, 이 때 까지 만난 문들 중에 열 수 있는 것들을 queue에 넣음
+ if building[new_row][new_col].isalpha() and building[new_row][new_col].islower():
+ keys_i_have.add(building[new_row][new_col])
+ visited.add((new_row, new_col))
+ deq.append((new_row, new_col))
+
+ for can_open_row, can_open_col in door_info[building[new_row][new_col].upper()]:
+ if (can_open_row, can_open_col) in locked_doors_to_access:
+ building[can_open_row][can_open_col] = "."
+ visited.add((can_open_row, can_open_col))
+ deq.append((can_open_row, can_open_col))
+ locked_doors_to_access.discard((can_open_row, can_open_col))
+
+ continue
+
+ # 빈 공간일 경우, 그냥 지나감
+ if building[new_row][new_col] == ".":
+ visited.add((new_row, new_col))
+ deq.append((new_row, new_col))
+
+ print(answer)
\ No newline at end of file
diff --git "a/tgyuuAn/DFS/\354\212\244\353\217\204\354\277\240.py" "b/tgyuuAn/DFS/\354\212\244\353\217\204\354\277\240.py"
new file mode 100644
index 00000000..7905dc67
--- /dev/null
+++ "b/tgyuuAn/DFS/\354\212\244\353\217\204\354\277\240.py"
@@ -0,0 +1,78 @@
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+board = []
+
+for _ in range(9): board.append(list(input()))
+
+def dfs(board, now_row, now_col):
+
+ # 이미 들어있는 칸일 경우
+ if board[now_row][now_col] != "0":
+ new_row = now_row
+ new_col = now_col + 1
+
+ if new_col >= 9:
+ new_col = 0
+ new_row += 1
+
+ # 스도쿠 완성
+ if new_row >= 9: return board
+
+ temp = dfs(board, new_row, new_col)
+
+ if temp is not None: return temp
+
+ # 비어있는 칸일 경우
+ else:
+ need_number = { str(x) for x in range(1,10) }
+
+ # 가로 행 검사
+ for col in range(9):
+ if board[now_row][col] != "0":
+ need_number.discard(board[now_row][col])
+
+ # 세로 행 검사
+ for row in range(9):
+ if board[row][now_col] != "0":
+ need_number.discard(board[row][now_col])
+
+ # 3X3 검사
+ temp_row = (now_row//3)*3
+ temp_col = (now_col//3)*3
+ for inner_row in range(temp_row, temp_row+3):
+ for inner_col in range(temp_col, temp_col+3):
+ if board[inner_row][inner_col] != "0":
+ need_number.discard(board[inner_row][inner_col])
+
+ # 만약 넣을 수 있는것이 없으면 None을 리턴
+ if len(need_number) == 0: return None
+
+ need_number = sorted(list(map(int,need_number)))
+
+ for dedicate_number in need_number:
+ board[now_row][now_col] = str(dedicate_number)
+
+ new_row = now_row
+ new_col = now_col + 1
+
+ if new_col >= 9:
+ new_col = 0
+ new_row += 1
+
+ # 스도쿠 완성
+ if new_row >= 9: return board
+
+ temp = dfs(board, new_row, new_col)
+
+ if temp is not None: return temp
+
+ board[now_row][now_col] = "0"
+
+ return None
+
+answer = dfs(board, 0, 0)
+
+for row in answer:
+ print("".join(row))
\ No newline at end of file
diff --git a/tgyuuAn/DP/KCM Travel.py b/tgyuuAn/DP/KCM Travel.py
new file mode 100644
index 00000000..4e279062
--- /dev/null
+++ b/tgyuuAn/DP/KCM Travel.py
@@ -0,0 +1,30 @@
+from collections import defaultdict, deque
+import sys
+
+def input(): return sys.stdin.readline().rstrip()
+
+T = int(input())
+for _ in range(T):
+ N, M, K = map(int, input().split())
+
+ costs = [[int(1e9) for _ in range(M+1)] for _ in range(N+1)]
+ costs[1][0] = 0
+
+ graph = [[] for _ in range(N+1)]
+ for _ in range(K):
+ start, destination, cost, duration = map(int,input().split())
+ graph[start].append((destination, cost, duration))
+
+ # print(edges)
+
+ for cost in range(M+1):
+ for city in range(1, N):
+ if costs[city][cost] == int(1e9): continue
+
+ for now_destination, now_cost, now_duration in graph[city]:
+
+ if now_cost + cost <= M and costs[now_destination][cost + now_cost] > costs[city][cost] + now_duration:
+ costs[now_destination][cost + now_cost] = costs[city][cost] + now_duration
+
+ result = min(costs[N])
+ print(result) if result != int(1e9) else print("Poor KCM")
\ No newline at end of file
diff --git "a/tgyuuAn/DP/\354\236\220\353\221\220\353\202\230\353\254\264.py" "b/tgyuuAn/DP/\354\236\220\353\221\220\353\202\230\353\254\264.py"
new file mode 100644
index 00000000..051a4cde
--- /dev/null
+++ "b/tgyuuAn/DP/\354\236\220\353\221\220\353\202\230\353\254\264.py"
@@ -0,0 +1,37 @@
+import sys
+
+def input(): return sys.stdin.readline()
+
+T, W = map(int,input().split())
+
+# DP[i][j][k] i초에 [j]위치에 있고 [k]번의 횟수를 이동했을 때 받을 수 있는 자두 수
+DP = [[[0 for _ in range(W+1)] for _ in range(2+1)] for _ in range(T+1)]
+
+plums = []
+for _ in range(T):
+ plums.append(int(input()))
+
+for time, plum in zip(range(1,T+1), plums):
+
+ for k in range(W+1):
+ if k == 0:
+ if plum == 1:
+ DP[time][1][k] = DP[time-1][1][k]+1
+ DP[time][2][k] = DP[time-1][2][k]
+
+ else:
+ DP[time][1][k] = DP[time-1][1][k]
+ DP[time][2][k] = DP[time-1][2][k]+1
+ continue
+
+ if plum == 1:
+ DP[time][1][k] = max(DP[time-1][1][k],DP[time-1][2][k-1])+1
+ DP[time][2][k] = max(DP[time-1][1][k-1],DP[time-1][2][k])
+
+ else:
+ DP[time][1][k] = max(DP[time-1][1][k],DP[time-1][2][k-1])
+ DP[time][2][k] = max(DP[time-1][1][k-1],DP[time-1][2][k])+1
+
+ DP[time][2][0] = 0
+
+print(max([max(x) for x in DP[-1]]))
\ No newline at end of file
diff --git a/tgyuuAn/README.md b/tgyuuAn/README.md
index 530f4f4a..8b390814 100644
--- a/tgyuuAn/README.md
+++ b/tgyuuAn/README.md
@@ -29,17 +29,28 @@
| 25차시 | 2023.12.26 | 구현 | 방의 개수 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/90
| 26차시 | 2023.12.29 | BFS | 백조의 호수 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/95
| 27차시 | 2024.01.01 | BFS | 탈옥 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/96
-| 28차시 | 2023.01.04 | 스택 | 히스토그램에서 가장 큰 직사각형 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/99
-| 29차시 | 2023.01.07 | 그리디 | 소트 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/103
-| 30차시 | 2023.01.10 | BFS | 아이템 줍기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/104
-| 31차시 | 2023.01.13 | DP | 진우의 달 여행 (Large) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/105
-| 32차시 | 2023.01.16 | 그리디 | 멀티탭 스케줄링 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/108
-| 33차시 | 2023.01.19 | 이분 탐색 | 배열에서 이동 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/115
-| 34차시 | 2023.01.22 | 힙 | 가운데를 말해요 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/116
-| 35차시 | 2023.01.25 | 이분 탐색 | 공유기 설치 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/120
-| 36차시 | 2023.02.04 | BFS | 로봇 청소기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/126
-| 37차시 | 2023.02.04 | BFS | 교환 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/131
-| 38차시 | 2023.02.15 | DP | 피보나치 수 3 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/137
-| 39차시 | 2023.02.18 | DP | 앱 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/139
-| 40차시 | 2023.02.21 | DP | 입대 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/142
+| 28차시 | 2024.01.04 | 스택 | 히스토그램에서 가장 큰 직사각형 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/99
+| 29차시 | 2024.01.07 | 그리디 | 소트 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/103
+| 30차시 | 2024.01.10 | BFS | 아이템 줍기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/104
+| 31차시 | 2024.01.13 | DP | 진우의 달 여행 (Large) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/105
+| 32차시 | 2024.01.16 | 그리디 | 멀티탭 스케줄링 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/108
+| 33차시 | 2024.01.19 | 이분 탐색 | 배열에서 이동 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/115
+| 34차시 | 2024.01.22 | 힙 | 가운데를 말해요 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/116
+| 35차시 | 2024.01.25 | 이분 탐색 | 공유기 설치 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/120
+| 36차시 | 2024.02.04 | BFS | 로봇 청소기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/126
+| 37차시 | 2024.02.04 | BFS | 교환 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/131
+| 38차시 | 2024.02.15 | DP | 피보나치 수 3 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/138
+| 39차시 | 2024.02.18 | DP | 앱 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/139
+| 40차시 | 2024.02.21 | DP | 입대 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/142
+| 41차시 | 2024.03.04 | DP | 자두나무 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/148
+| 42차시 | 2024.03.07 | DFS | 스도쿠 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/152
+| 43차시 | 2024.03.10 | 이분 탐색 | 징검다리 건너기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/157
+| 44차시 | 2023.03.13 | 트라이 | 개미굴 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/159
+| 45차시 | 2023.03.16 | 트라이 | 트라이 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/162
+| 46차시 | 2023.03.20 | 트라이 | AB | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/165
+| 47차시 | 2023.03.22 | 수학, 분할정복 | 너 봄에는 캡사이신이 맛있단다 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/167
+| 48차시 | 2023.03.25 | 벨만 포드 | 골목길 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/171
+| 49차시 | 2023.03.29 | DP | KCM Travel | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/174
+| 50차시 | 2024.04.01 | BFS | 열쇠 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/175
+| 51차시 | 2023.04.07 | BFS | 과외맨 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/179
---
diff --git "a/tgyuuAn/\353\262\250\353\247\214 \355\217\254\353\223\234/\352\263\250\353\252\251\352\270\270.py" "b/tgyuuAn/\353\262\250\353\247\214 \355\217\254\353\223\234/\352\263\250\353\252\251\352\270\270.py"
new file mode 100644
index 00000000..b879b593
--- /dev/null
+++ "b/tgyuuAn/\353\262\250\353\247\214 \355\217\254\353\223\234/\352\263\250\353\252\251\352\270\270.py"
@@ -0,0 +1,78 @@
+import sys
+from collections import deque
+
+def input(): return sys.stdin.readline().rstrip()
+
+N, M = map(int, input().split())
+edge = [[] for _ in range(N+1)]
+
+# 간선 정보 받음
+for _ in range(M):
+ start, destination, cost = map(int,input().split())
+ edge[start].append([destination, cost])
+
+# 초기 세팅
+board = [-int(1e9) for _ in range(N+1)]
+board[1] = 0
+
+# 최적의 경로를 찾기 위해 역추적 하기 위해서 이전 노드를 기록
+prev_node = [-1 for _ in range(N+1)]
+prev_node[1] = 0
+
+for _ in range(N-1):
+ for start in range(1,N+1):
+ for destination, cost in edge[start]:
+ if board[destination] < board[start] + cost:
+ board[destination] = board[start] + cost
+ prev_node[destination] = start
+
+has_cycle = False
+is_connect_target = False
+for start in range(1,N+1):
+ for destination, cost in edge[start]:
+ # 사이클 발생
+ if board[destination] < board[start] + cost:
+ has_cycle = True
+
+ # 사이클이 발생해도 경로랑 관련이 없을 수도 있으므로,
+ # 사이클이 발생한 지점이 목표 지점과 관련이 있는지 체크크
+ deq = deque([start])
+ visited = {start,}
+ while deq:
+ now = deq.popleft()
+
+ for d, c in edge[now]:
+ if d in visited: continue
+
+ deq.append(d)
+ visited.add(d)
+
+ # 사이클이 있고 목표지점 혹은 시작지점과 붙어있으면 -1
+ if d == 1 or d == N:
+ is_connect_target = True
+ break
+
+ if is_connect_target: break
+ break
+
+# 사이클이 있는데 해당 사이클이 목표와 연결되어 있을 경우
+if has_cycle and is_connect_target: print(-1)
+else:
+ answer = []
+ now = N
+ while now != 1:
+ answer.append(now)
+ now = prev_node[now]
+
+ answer.append(now)
+
+ if now != 1: print(-1)
+ else: print(*answer[::-1])
+
+# 총 간선 = 2만개,
+# 총 노드 = 100개
+# 벨만 포드 = ( 간선 X 노드 -1 ) -> 198만 시간 복잡도 가능.
+
+# 최적의 경로
+# 사이클이 발생해도 갈 수 있을 수 있음.
+# 사이클이 없더라도 도달할 수 없을 수 있음.
\ No newline at end of file
diff --git "a/tgyuuAn/\354\210\230\355\225\231/\353\204\210 \353\264\204\354\227\220\353\212\224 \354\272\241\354\202\254\354\235\264\354\213\240\354\235\264 \353\247\233\354\236\210\353\213\250\353\213\244.py" "b/tgyuuAn/\354\210\230\355\225\231/\353\204\210 \353\264\204\354\227\220\353\212\224 \354\272\241\354\202\254\354\235\264\354\213\240\354\235\264 \353\247\233\354\236\210\353\213\250\353\213\244.py"
new file mode 100644
index 00000000..ac903fbb
--- /dev/null
+++ "b/tgyuuAn/\354\210\230\355\225\231/\353\204\210 \353\264\204\354\227\220\353\212\224 \354\272\241\354\202\254\354\235\264\354\213\240\354\235\264 \353\247\233\354\236\210\353\213\250\353\213\244.py"
@@ -0,0 +1,33 @@
+import sys
+
+DIV = 1_000_000_007
+
+def input(): return sys.stdin.readline().rstrip()
+
+def power(n, over):
+ if over == 0: return 1
+ elif over == 1: return n
+ elif over %2 == 0:
+ half = (power(n, over//2) % DIV)
+ return (half * half) % DIV
+ else:
+ half = (power(n, over//2) % DIV)
+ return (half * half * (n % DIV)) % DIV
+
+N = int(input())
+numbers = sorted(list(map(int,input().split())))
+DP = [-1 for _ in range(N)]
+answer = 0
+
+for start_idx in range(N):
+ start_num = numbers[start_idx]
+ end_num = numbers[N-start_idx-1]
+
+ # 만약 캐싱이 되어있지 않을 경우 직접 계산
+ if DP[N-start_idx-1] == -1: DP[N-start_idx-1] = power(2, N-start_idx-1)
+
+ # 한번이라도 계산 했으면 바로 이용
+ answer += ((end_num % DIV) * (DP[N-start_idx-1] % DIV)) % DIV
+ answer -= ((start_num % DIV) * (DP[N-start_idx-1] % DIV)) % DIV
+
+print(answer % DIV)
\ No newline at end of file
diff --git "a/tgyuuAn/\354\235\264\354\247\204 \355\203\220\354\203\211/\353\260\260\354\227\264\354\227\220\354\204\234 \354\235\264\353\217\231.py" "b/tgyuuAn/\354\235\264\353\266\204 \355\203\220\354\203\211/\353\260\260\354\227\264\354\227\220\354\204\234 \354\235\264\353\217\231.py"
similarity index 100%
rename from "tgyuuAn/\354\235\264\354\247\204 \355\203\220\354\203\211/\353\260\260\354\227\264\354\227\220\354\204\234 \354\235\264\353\217\231.py"
rename to "tgyuuAn/\354\235\264\353\266\204 \355\203\220\354\203\211/\353\260\260\354\227\264\354\227\220\354\204\234 \354\235\264\353\217\231.py"
diff --git "a/tgyuuAn/\354\235\264\353\266\204 \355\203\220\354\203\211/\354\247\225\352\262\200\353\213\244\353\246\254 \352\261\264\353\204\210\352\270\260.py" "b/tgyuuAn/\354\235\264\353\266\204 \355\203\220\354\203\211/\354\247\225\352\262\200\353\213\244\353\246\254 \352\261\264\353\204\210\352\270\260.py"
new file mode 100644
index 00000000..bbe6c556
--- /dev/null
+++ "b/tgyuuAn/\354\235\264\353\266\204 \355\203\220\354\203\211/\354\247\225\352\262\200\353\213\244\353\246\254 \352\261\264\353\204\210\352\270\260.py"
@@ -0,0 +1,25 @@
+def check(mid, stones, k):
+ gap = 0
+ for stone in stones:
+ if stone - mid < 0: gap += 1
+ else: gap = 0
+
+ if gap >= k: return False
+ return True
+
+def solution(stones, k):
+ left = -1
+ right = 200000001
+ answer = 0
+
+ while left+1