유형별 문제풀이 tony - 투포인터
배열 합치기 백준 11728
파이썬
n,m=map(int,input().split())
a=[*map(int,input().split())]
b=[map(int,input().split())]
print(a)
print(b)
from heapq import merge
input()
a = list(map(int,input().split()))
b = list(map(int,input().split()))
print(merge(a,b))
print(*merge(a,b))
유형별 문제풀이 tony - 동적계획법
피보나치수5 백준 10870
유형별 문제풀이 tony - 그리디
거스름돈 백준 14916
- 문제
- 코드
- 내 코드에서 while문 돌릴 필요 없다. 어차피 2로 한번 안나눠 떨어지면은 +5를 해주니까 홀수 + 홀수 = 짝수라 한 번만 연산해주면 2로 나눠 떨어진다.
- 그리고 max_five < 0 나오는 경우는 1, 3 밖에 없다.
- 파이썬 몫과 나머지를 구해주는 divmod를 활용하자