250x250
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 | 31 |
Tags
- 파이썬
- Retrieval
- REST API
- 신경망 학습
- 밑바닥부터 시작하는 딥러닝
- n과 m
- 15649
- 1101
- 경사하강법
- 그리디 알고리즘
- streamlit
- BOJ
- 9020
- N-Queen
- 재귀
- 손실함수
- 가상환경
- 백준
- Python
- 1002
- 백트래킹
- pyenv
- 티스토리챌린지
- 기계학습
- 4948
- 파이싼
- 개발환경
- 오블완
- video retireval
- end to end
Archives
- Today
- Total
파이톨치
[백준] 1049 본문
728x90
n, m = map(int, input().split())
s = []
k = []
for i in range(m):
a, b = map(int, input().split())
s.append(a)
k.append(b)
best1 = min(s)
best2 = min(k)
best = min([best1, best2*6])
cost = 0
while n >= 6:
cost += best
n -= 6
if best < n*best2:
cost += best
else:
cost += n*best2
print(cost)
728x90