답안 #23087

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
23087 2017-05-02T17:26:01 Z model_code Pareto (COCI17_pareto) Python 3
80 / 80
544 ms 30 KB
n = int(input())
niz = list(map(int, input().split()))
niz.sort(reverse=True)
ukupno = sum(niz)
a = 1
b = 1
tmp = 0
for i in range(n):
    tmp += niz[i]
    if tmp/ukupno - (i + 1)/n > b - a:
        a = (i + 1) / n
        b = tmp / ukupno
print(a * 100)
print(b * 100)
#print(a * 100, b * 100)
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 3 KB Output is correct
2 Correct 26 ms 3 KB Output is correct
3 Correct 29 ms 3 KB Output is correct
4 Correct 31 ms 3 KB Output is correct
5 Correct 39 ms 4 KB Output is correct
6 Correct 168 ms 13 KB Output is correct
7 Correct 421 ms 24 KB Output is correct
8 Correct 544 ms 30 KB Output is correct