일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- nav-tab
- dp
- 트리
- HTML
- 라즈비안
- NAV
- 라즈베리파이3
- 2909
- 파이썬
- 알고리즘
- 라즈베리파이
- Crawling
- 라즈베리파이3b+
- raspberrypi
- node.js
- Algorythm
- springboot3.x
- ubuntu
- CSS
- algotythm
- dynaminprogramming
- MongoDB
- 13237
- 크롤링
- baekjun
- 16.04
- 백준
- 2579
- Python
- bootstrap
Archives
- Today
- Total
목록5567 (1)
노트
[백준] 5567번 결혼식 python
from collections import deque def bfs(node): queue = deque() queue.append(node) while queue: node = queue.popleft() for n in friend[node]: if check[n] == 0: check[n] = check[node]+1 queue.append(n) n = int(input()) m = int(input()) friend = [[] for _ in range(n+1)] for j in range(m): a,b=map(int,input().split(' ')) friend[a].append(b) friend[b].append(a) check = [0]*(n+1) check[1] = 1 bfs(1) res..
알고리즘
2023. 7. 30. 15:05