# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597437 | KK_1729 | Pareto (COCI17_pareto) | Cpython 3 | 439 ms | 65536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n = int(input())
a = sorted(list(map(int, input().split())))
pairs = [];o = sum(a);e = 0
for i, item in enumerate(a):
e += item
pairs.append([((i+1)/n * 100), (e/o * 100)])
e = 0
for i, item in enumerate(a[::-1]):
e += item
pairs.append([((i+1)/n * 100), (e/o * 100)])
maximum = float("-inf")
best_pair = None
for pair in pairs:
# print(pair[1]-pair[0])
if pair[1]-pair[0] > maximum:
best_pair = pair
maximum = pair[1]-pair[0]
# print(maximum, best_pair)
print(*best_pair, sep="\n")
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |