일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 파이썬
- Python
- Lv. 0
- Baekjoon
- Dynamic Programming
- bfs
- Lv. 1
- DP
- softeer
- LEVEL 2
- Lv. 2
- SQL 고득점 KIT
- level 3
- Java
- 프로그래머스
- Lv. 3
- 소프티어
- 백준
- 오블완
- 너비 우선 탐색
- dfs
- javascript
- group by
- SQL
- 자바스크립트
- 티스토리챌린지
- 깊이 우선 탐색
- 동적계획법
- join
- Today
- Total
목록Python (145)
몸과 마음이 건전한 SW 개발자
문제 링크 https://www.acmicpc.net/problem/2470 2470번: 두 용액 첫째 줄에는 전체 용액의 수 N이 입력된다. N은 2 이상 100,000 이하이다. 둘째 줄에는 용액의 특성값을 나타내는 N개의 정수가 빈칸을 사이에 두고 주어진다. 이 수들은 모두 -1,000,000,000 이상 1,000,00 www.acmicpc.net 정답 코드 import sys input = sys.stdin.readline N = int(input()) SOLUTIONS = sorted(list(map(int, input().split()))) answer = [] twoSum = 2000000001 isFound = False for i in range(N): # 처음 부터 시작 startSo..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/67258 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 def solution(gems): type_count = len(set(gems)) # 보석의 종류 수 left, right = 0, 0 lenGems = len(gems) answer = [0, lenGems - 1] gem_map = dict() # 현재 윈도우에 있는 보석의 종류와 수를 저장 while right < lenGems: # 윈도우를 오른쪽으로 확장 if g..

문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42579 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 def solution(genres, plays): answer = [] genreDict = dict() lenGenres = len(genres) for i in range(lenGenres): genre = genres[i] play = plays[i] if genreDict.get(genre): genreDict[genre].append((play, i)) genreD..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/43163 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 from collections import deque def solution(begin, target, words): lenWords = len(words) lenW = len(begin) V = [0 for _ in range(lenWords+1)] q = deque() q.append((begin, lenWords)) result = 1e9 isFound = False w..

문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/43162 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 from collections import deque def solution(n, computers): answer = 0 adjL = [[] for _ in range(n+1)] for i in range(n): for j in range(i, n): if i == j: continue if computers[i][j]: adjL[i+1].append(j+1) adjL[j+..
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/42628 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 정답 코드 import heapq def solution(operations): maxHeap = [] minHeap = [] for operation in operations: oper, number = operation.split() number = int(number) if oper == "I": heapq.heappush(maxHeap, -number) heapq.heappush..