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
- level2
- dict
- BFS
- 구현
- BOJ
- programmers
- 가상메모리 관리
- level1
- 딕셔너리
- 힙
- N과M
- 파이썬
- 브루트포스
- 다이나믹 프로그래밍
- 그리디
- MYSQL
- DP
- 다익스트라
- level3
- level0
- 재귀
- 가상메모리
- 스택
- 운영체제
- 백준
- python
- 코딩테스트
- 프로그래머스
- dfs
- 수학
Archives
- Today
- Total
목록섬 연결하기 (1)
동캄의 코딩도장
프로그래머스 level3 [섬 연결하기] 파이썬
https://programmers.co.kr/learn/courses/30/lessons/42861 코딩테스트 연습 - 섬 연결하기 4 [[0,1,1],[0,2,2],[1,2,5],[1,3,1],[2,3,8]] 4 programmers.co.kr # 프로그래머스 섬 연결하기 def solution(n, costs): answer = 0 costs.sort(key=lambda x: x[2]) island = {} cnt = 0 for i in range(n): island[i] = 0 a, b, c = costs.pop(0) island[a] += 1 island[b] += 1 answer += c cnt += 1 while cnt != n-1: for i in range(len(costs)): a, b..
코테/프로그래머스
2022. 4. 8. 12:14