일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 힙
- programmers
- 그리디
- 구현
- dict
- level2
- 딕셔너리
- 재귀
- 코딩테스트
- DP
- python
- level0
- 운영체제
- 백준
- BFS
- 브루트포스
- level1
- level3
- 스택
- 수학
- dfs
- 가상메모리 관리
- N과M
- 다익스트라
- 다이나믹 프로그래밍
- 가상메모리
- 프로그래머스
- BOJ
- 파이썬
- MYSQL
- Today
- Total
목록프로그래머스 (123)
동캄의 코딩도장
https://programmers.co.kr/learn/courses/30/lessons/12900 코딩테스트 연습 - 2 x n 타일링 가로 길이가 2이고 세로의 길이가 1인 직사각형모양의 타일이 있습니다. 이 직사각형 타일을 이용하여 세로의 길이가 2이고 가로의 길이가 n인 바닥을 가득 채우려고 합니다. 타일을 채울 때는 programmers.co.kr https://www.acmicpc.net/problem/11726 11726번: 2×n 타일링 2×n 크기의 직사각형을 1×2, 2×1 타일로 채우는 방법의 수를 구하는 프로그램을 작성하시오. 아래 그림은 2×5 크기의 직사각형을 채운 한 가지 방법의 예이다. www.acmicpc.net # 프로그래머스 2 x n 타일링 def solution(n..
https://programmers.co.kr/learn/courses/30/lessons/49189 코딩테스트 연습 - 가장 먼 노드 6 [[3, 6], [4, 3], [3, 2], [1, 3], [1, 2], [2, 4], [5, 2]] 3 programmers.co.kr # 프로그래머스 가장 먼노드 def solution(n, edge): answer = 0 visited = [0]*(n+1) cnt = [10000]*(n+1) link = [[] for _ in range(n+1)] for e in edge: a, b = e link[a].append(b) link[b].append(a) cnt[1] = 0 def serach_dfs(node, count_): cnt[int(node)] = min..
https://programmers.co.kr/learn/courses/30/lessons/43164 코딩테스트 연습 - 여행경로 [["ICN", "SFO"], ["ICN", "ATL"], ["SFO", "ATL"], ["ATL", "ICN"], ["ATL","SFO"]] ["ICN", "ATL", "ICN", "SFO", "ATL", "SFO"] programmers.co.kr # 프로그래머스 여행경로 def solution(tickets): global answer answer = [] fromto = {} manage_ticket = {} temp = [] for ticket in tickets: dep, arr = ticket manage_ticket[dep+arr] = 0 fromto[dep] ..
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..
https://programmers.co.kr/learn/courses/30/lessons/42628 코딩테스트 연습 - 이중우선순위큐 programmers.co.kr # 프로그래머스 이중우선순위큐 import heapq def solution(operations): answer = [] heap = [] for operation in operations: oper, digit = map(str, operation.split()) if oper == 'I': heapq.heappush(heap, int(digit)) elif heap and oper == 'D' and digit == '1': heap = heapq.nlargest(len(heap), heap)[1:] heapq.heapify(heap)..
https://programmers.co.kr/learn/courses/30/lessons/42627 코딩테스트 연습 - 디스크 컨트롤러 하드디스크는 한 번에 하나의 작업만 수행할 수 있습니다. 디스크 컨트롤러를 구현하는 방법은 여러 가지가 있습니다. 가장 일반적인 방법은 요청이 들어온 순서대로 처리하는 것입니다. 예를 programmers.co.kr def solution(jobs): answer = 0 schedule = [] jobs.sort() length = len(jobs) end = 0 while jobs: if schedule: #대기 열이 존재하는 경우 start, spend = schedule.pop() answer += (spend+end-start) end += spend else:..