from collections import deque from itertools import combinations import copy n, m = map(int, input().split()) graph = [] two = [] answer = 0 for _ in range(n): graph.append(list(map(int, input().split()))) dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def bfs(): two = deque() graph_ = copy.deepcopy(graph) for i in range(n): for j in range(m): if graph_[i][j] == 2: two.append([i,j]) while two: y, x = two..
import sys input = sys.stdin.readline n, m = map(int, input().split()) graph = [] visited = [[0 for _ in range(m)] for _ in range(n)] dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] for _ in range(n): graph.append(list(map(int, input().split()))) def dfs(y, x, count): if visited[y][x] == 0: visited[y][x] = 1 if graph[y][x] != 0: graph[y][x] = count for i in range(4): nx = x + dx[i] ny = y + dy[i] if 0
- Total
- Today
- Yesterday
- version
- tensorflow
- 다익스트라
- matplotlib
- 파이썬
- docker
- 설치하기
- 프로그래머스
- CUDA
- error
- dfs
- 동적프로그래밍
- LGSVL
- 백준
- numpy
- n과m
- 백트래킹
- 코딩테스트
- notfound
- Python
- 설치
- torch
- 카카오
- torchscript
- 이것이코딩테스트다
- shellscript
- BFS
- pytorch
- PIP
- 최소신장트리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |