Skip to content

Commit 9bdbeca

Browse files
committed
codetree.ai 삼성전자 2025 하반기 오후 1번 문제 AI 로봇청소기
문제 링크: https://www.codetree.ai/ko/frequent-problems/all/problems/ai-robot
1 parent ca50fee commit 9bdbeca

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • codetree.ai 삼성전자 2025 하반기 오후 1번 문제 AI 로봇청소기

codetree.ai 삼성전자 2025 하반기 오후 1번 문제 AI 로봇청소기/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def solve():
3636

3737
if visited[sr][sc] == False: # 인접한 칸에서오는 중복 방문 제거
3838
if dt[sr][sc] > 0:
39-
candidates.append([0, sr, sc])
39+
candidates.append([sr, sc])
4040

4141
visited[sr][sc] = True
4242
queue_next.append([depth, sr, sc])
@@ -58,8 +58,7 @@ def solve():
5858
robots_next.append([robot_sr, robot_sc])
5959
else:
6060
candidates.sort()
61-
_, r, c = candidates[0]
62-
robots_next.append([r, c])
61+
robots_next.append(candidates[0])
6362

6463
robots = robots_next
6564

0 commit comments

Comments
 (0)