일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 코딩테스트
- level3
- dfs
- 투포인터
- 에라스토테네스의 체
- N과M
- 다이나믹 프로그래밍
- 힙
- 스택
- 프로그래머스
- 다익스트라
- level2
- 딕셔너리
- 운영체제
- 가상메모리
- 그리디
- 재귀
- python
- 가상메모리 관리
- 브루트포스
- DP
- BFS
- level1
- 수학
- programmers
- BOJ
- 파이썬
- MYSQL
- 구현
- 백준
- Today
- Total
목록백준 (201)
동캄의 코딩도장
https://www.acmicpc.net/problem/16987 # 백준 16987 계란으로 계란치기N=int(input())eggs=[]eggs_break=[False for _ in range(N)]ans=0for _ in range(N): #계란 정보 저장 dur,wei=map(int,input().split()) eggs.append([dur,wei])def strike_egg(curr,cnt): #현재 손에 쥐고 있는 계란 정보와 현재 깨진 계란 정보를 인자로 받음 global ans ans=max(ans,cnt) #가장 많이 깨진 경우 확인 if curr==N: #가장 오른쪽 계란까지 확인했다면 더이상 탐색하지 않음 return if not e..
https://www.acmicpc.net/problem/14889# 백준 14889 스타트와 링크from collections import dequeN=int(input())field=[]for _ in range(N): field.append(list(map(int,input().split()))) #전체 경우 저장visited=[0 for _ in range(N)]team=deque()ans=10**9 def team_match(curr): #팀에 인원을 추가하여, 팀을 두개로 분리하여(방문한 팀 vs 방문안한 팀) 차이 비교 global ans if len(team)==N//2: team_ano=deque() for i in range(N): ..
https://www.acmicpc.net/problem/13335 생각보다 시간이 오래 걸렸다. 알고리즘은 간단한데.. 구현하는게 생각보다 어려웠다.#백준 13335 트럭from collections import dequen,w,l=map(int,input().split()) # 트럭수, 통과시간, 제한하중trucks=list(map(int,input().split())) #트럭 배열 저장trucks=deque(trucks) # 트럭 배열 덱으로 변환truck_on_brdg=deque([]) # 다리위에 있는 트럭 덱 초기화ans=0 #정답 (총 시간간)total_weight=0 # 총 무게 def search(): global ans global total_weight i=0 w..
https://www.acmicpc.net/problem/1182# 백준 1182 부분수열의 합N,S=map(int,input().split())lst=list(map(int,input().split()))lst.sort() #정렬ans=0 #정답def search(start): global ans if s and sum(s)==S: #S와 부분집합의 합이 같다면 ans+=1 #정답 갯수 증가 for i in range(start,N): if visit[i]==0: #방문하지 않았다면 s.append(lst[i]) #배열에 추가 visit[i]=1 #방문확인 search(i) #재귀적으로 탐색하되, 이전에..
https://www.acmicpc.net/problem/1547# 백준 1547 공N=int(input())dic_cup={1:True,2:False,3:False}for _ in range(N): a_cup,b_cup=map(int,input().split()) temp=dic_cup[a_cup] dic_cup[a_cup]=dic_cup[b_cup] dic_cup[b_cup]=tempif dic_cup[1]==True: print(1)elif dic_cup[2]==True: print(2)elif dic_cup[3]==True: print(3)
https://www.acmicpc.net/problem/15665 #백준 15664 N과M (11)from collections import dequen,m=map(int,input().split())lst=list(map(int,input().split()))lst.sort()s=deque()ans=[]def search(): if len(s)==m: #길이를 만족하면 ans.append(' '.join(map(str,s))) #정답 배열에 저장 return for i in range(n): #배열에 추가 s.append(lst[i]) search() s.pop()search()ans=set(ans) #중복 제거result=[]..