Skip to content

Commit 2aeabdd

Browse files
committed
[Gold V] Title: 뱀과 사다리 게임, Time: 112 ms, Memory: 110068 KB -BaekjoonHub
1 parent 9f81388 commit 2aeabdd

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

백준/Gold/16928. 뱀과 사다리 게임/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 110068 KB, 시간: 116 ms
7+
메모리: 110068 KB, 시간: 112 ms
88

99
### 분류
1010

1111
너비 우선 탐색, 그래프 이론, 그래프 탐색
1212

1313
### 제출 일자
1414

15-
2025년 3월 24일 12:46:55
15+
2025년 3월 30일 14:34:44
1616

1717
### 문제 설명
1818

백준/Gold/16928. 뱀과 사다리 게임/뱀과 사다리 게임.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
adj = {i: i for i in range(1, 101)}
55

66
for _ in range(N+M):
7-
x, y = map(int, input().split())
8-
adj[x] = y
7+
a, b = map(int, input().split())
8+
adj[a] = b
99

10-
q = deque([(1, 0)])
1110
visited = [False] * 101
1211
visited[1] = True
12+
q = deque([(1, 0)])
13+
1314
while q:
14-
pos, step = q.popleft()
15+
now, step = q.popleft()
1516

16-
if pos == 100:
17+
if now == 100:
1718
print(step)
1819
break
19-
20+
2021
for i in range(1, 7):
21-
next = pos + i
22+
next = now + i
2223
if next > 100:
2324
continue
2425

0 commit comments

Comments
 (0)