Skip to content

Commit c35823d

Browse files
authored
Create 1106_호텔(G4)_fail.py
1 parent 4359f16 commit c35823d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
C, N = map(int, input().split())
2+
# C : 적어도 C명 늘이기
3+
# N : 도시의 개수
4+
5+
cost=[] # 홍보 시 드는 비용
6+
customer=[] # 얻을 수 있는 고객의 수
7+
8+
for i in range(N):
9+
# a : 비용, b : 증원되는 사람 수
10+
a,b=map(int, input().split())
11+
cost.append(a)
12+
customer.append(b)
13+
14+
def f(c):
15+
if c<=0: return 0
16+
else:
17+
min_m = 999999999
18+
for i in range(0,N):
19+
min_m = min(min_m, f(c-cost[i])+customer[i])
20+
return min_m
21+
22+
print(f(C))

0 commit comments

Comments
 (0)