Submission #597437

#TimeUsernameProblemLanguageResultExecution timeMemory
597437KK_1729Pareto (COCI17_pareto)Cpython 3
60 / 80
439 ms65536 KiB
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 timeMemoryGrader output
Fetching results...