Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Vocoder
- 한국어 tts
- 학습
- 딥러닝
- melgan
- tacotron
- 한국어 음성 합성
- text-to-speech
- 딥러닝 보코더
- 음성 합성
- YOLO
- 딥러닝 음성 합성
- deep voice
- DCTTS
- singing voice synthesis
- 윈도우
- TTS
- 타코트론
- 보코더
- 노래합성
- korean tts
- you only look once
- waveglow
- 트레이닝
Archives
- Today
- Total
chldkato
백준 2178 미로 탐색 (파이썬) 본문
https://www.acmicpc.net/problem/2178
2178번: 미로 탐색
첫째 줄에 두 정수 N, M(2 ≤ N, M ≤ 100)이 주어진다. 다음 N개의 줄에는 M개의 정수로 미로가 주어진다. 각각의 수들은 붙어서 입력으로 주어진다.
www.acmicpc.net
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
def bfs(x, y):
q = [[x, y]]
d[x][y] = 1
while q:
x = q[0][0]
y = q[0][1]
q.pop(0)
for i in range(4):
nx = x + dx[i]
ny = y + dy[i]
if 0 <= nx < n and 0 <= ny < m:
if a[nx][ny] == 1 and d[nx][ny] == 0:
q.append([nx, ny])
d[nx][ny] = d[x][y] + 1
n, m = map(int, input().split())
a = [list(map(int, input())) for _ in range(n)]
d = [[0]*m for _ in range(n)]
bfs(0, 0)
print(d[n-1][m-1])
'백준' 카테고리의 다른 글
백준 7576 토마토 (파이썬) (0) | 2020.02.27 |
---|---|
백준 2667 단지번호붙이기 (파이썬) (0) | 2020.02.27 |
백준 2931 가스관 (파이썬) (2) | 2020.02.26 |
백준 2151 거울 설치 (파이썬) (0) | 2020.02.25 |
백준 1981 배열에서 이동 (파이썬) (0) | 2020.02.25 |
Comments