Skip to content

Commit 6822e4c

Browse files
committed
[BOJ]#2437. 저울 /골드2/실패
https://www.acmicpc.net/problem/2437
1 parent 56543cb commit 6822e4c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Hongjoo/백준/저울.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
https://www.acmicpc.net/problem/2437
3+
4+
# 문제
5+
- 저울 N개의 조합의 합으로 구현할 수 없는 양의 최소값 구하기
6+
- N<=1000개
7+
- 1개 무게 >= 1,000,0000
8+
유형 : 그리디 , 정렬
9+
10+
"""
11+
#1. 입력 저울추 & 오름차순 정렬
12+
N = int(input())
13+
weights = sorted(list(map(int, input().split())))
14+
target = 1
15+
for w in weights :
16+
if target < w :
17+
break
18+
19+
target += w
20+
print(target)

0 commit comments

Comments
 (0)