//N을 아는 경우
n=int(input())
graph=[[] for _ in range(n+1)]
graph[p].append([b,c])
//같은 형식이지만 N을 모를경우
graph={}
graph[p] = (c, v)'코딩테스트 > Python 개념' 카테고리의 다른 글
| [Python] deque의 최대 길이 설정 deque(iterable, maxlen) (0) | 2024.06.20 |
|---|---|
| [Python] eval() 문자열로된 식을 계산 (1) | 2024.02.16 |
| [Python] 리스트 회전시킬때 deque.rotate() (0) | 2023.04.09 |
| [Python] 리스트 복사 copy.deepcopy( ) (0) | 2023.03.30 |
| [Python] 조합, 순열 리스트 말고 값으로 출력 math.comb / math.perm (0) | 2023.03.29 |