1번 문제.
https://www.acmicpc.net/problem/2309
-> 일곱 난쟁이
dwarf = []
for i in range(9) :
dwarf.append(int(input()))
sum_dwarf = sum(dwarf)
fake1 = 0
fake2 = 0
for i in range(9) :
for j in range(i+1, 9) :
if sum_dwarf - (dwarf[i] + dwarf[j]) == 100 :
fake1 = dwarf[i]
fake2 = dwarf[j]
dwarf.remove(fake1)
dwarf.remove(fake2)
dwarf.sort()
for k in dwarf :
print(k)
2번 문제.
https://www.acmicpc.net/problem/5800
-> 성적통계
x = int(input())
for i in range(1, x+1) :
n_score = list(map(int, input().split()))
n = int(n_score[0])
score = n_score[1:]
score.sort(reverse=True)
diff = 0
for j in range(len(score) - 1) :
diff = max(diff, score[j] - score[j+1])
print('Class {}'.format(i))
print('Max {}, Min {}, Largest gap {}'.format(score[0], score[-1], diff))