Skip to content

[Week 6] SORTGAME self review - profitjeanย #191

@profitjean

Description

@profitjean

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 ๋ถ€๋ถ„์€
ํ์˜ ๊ฐ’์ด ์กด์žฌํ•˜๋Š” ๋™์•ˆ๋ฐ˜๋ณต๋ฌธ์„ ํ†ตํ•ด ๊ตฌํ˜„์„ ํ•ด๋ณด๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2๊ธฐ์Šคํ„ฐ๋”” 2๊ธฐWAWrong Answer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions