QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#564462#8586. Partyiyedoo0 8ms10648kbPython3313b2024-09-15 01:42:332024-09-15 01:42:33

Judging History

你现在查看的是最新测评结果

  • [2024-09-15 01:42:33]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:10648kb
  • [2024-09-15 01:42:33]
  • 提交

answer

n = int(input())
a = list(map(int, input().split(" ")))

a.sort(reverse=True)

print(a)

happiness = 0

if n <= 200000:
  for i in range(n):
    if n % 2 == 0:
      if i + 1 <= n // 2:
        happiness += a[i]
    else:
      if i + 1 <= n // 2 + 1:
        happiness += a[i]

print(happiness)

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 8ms
memory: 10648kb

input:

5
3 2 -1 4 5

output:

[5, 4, 3, 2, -1]
12

result:

wrong answer 1st lines differ - expected: '12', found: '[5, 4, 3, 2, -1]'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%