-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2309.py
More file actions
33 lines (24 loc) · 708 Bytes
/
2309.py
File metadata and controls
33 lines (24 loc) · 708 Bytes
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
32
33
# 일곱 난쟁이
height = [int(input()) for _ in range(9)]
find = False
sumHeight = sum(height)
for i in range(0, 8):
for j in range(i+1, 9):
if (sumHeight-height[i]-height[j] == 100):
height = height[:j]+height[j+1:]
height = height[:i]+height[i+1:]
find = True
break
if (find):
break
height.sort()
for i in height:
print(i)
# 조합 라이브러리 사용해보기
# import itertools
# height = [int(input()) for _ in range(9)]
# heightCombination = itertools.combinations(height, 7)
# for heightList in heightCombination:
# if sum(heightList) == 100:
# print(*sorted(heightList), sep='\n')
# break