-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
SORTGAME self review 
1. ํด๊ฒฐ ์๋ ๊ณผ์
BFS๋ก ํ์ด๋ฅผ ํด๋ณด๋ ค๊ณ ํ๊ณ , ์
๋ ฅ๋ฐ์ดํฐ๋ฅผ ์ต์ ํํ๋ค๋ ๊ฒ์ ์ด์ ์ ๋์ด
๊ธธ์ด๋ฅผ 8๋ก ํต์ผ์์ผ์ค๋ค์ ์ต์ ์ ๋ ฌ ํ์๋ฅผ ๊ณ์ฐํ๋ ค๊ณ ํ์ต๋๋ค.
2. ์์ฑํ ์ฝ๋์ ์ค๋ช
import sys
from collections import deque
input = sys.stdin.readline
def bfs(start, length):
queue = deque()
queue.append((start, 0))
case = int(input().rstrip())
dp = {}
array = [str(num+1) for num in range(8)]
# bfs ํธ์ถํด์ผํจ
for _ in range(case):
n = int(input().rstrip())
array = list(map(int, input().rstrip().split()))
sorted_array = list(sorted(array))
mapped = dict(zip(sorted_arr, range(1,N+1)))3. ๋งํ ์ ๋ฐ ๊ฐ์ ์ฌํญ
์์ง ๊ตฌํํ์ง ๋ชปํ bfs ๋ถ๋ถ์
ํ์ ๊ฐ์ด ์กด์ฌํ๋ ๋์๋ฐ๋ณต๋ฌธ์ ํตํด ๊ตฌํ์ ํด๋ณด๋ ค๊ณ ํ์ต๋๋ค.