Skip to content

Commit 461a371

Browse files
authored
Create 4.py
1 parent c42b8a7 commit 461a371

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

11/4.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
n = int(input())
2+
data = list(map(int, input().split()))
3+
data.sort()
4+
5+
target = 1
6+
for x in data:
7+
# 만들 수 없는 금액을 찾았을 때 반복 종료
8+
if target < x:
9+
break
10+
target += x
11+
12+
# 만들 수 없는 금액 출력
13+
print(target)

0 commit comments

Comments
 (0)