QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#564464#8586. Partyiyedoo0 15ms10608kbPython3323b2024-09-15 01:44:402024-09-15 01:44:42

Judging History

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

  • [2024-09-15 01:44:42]
  • 评测
  • 测评结果:0
  • 用时:15ms
  • 内存:10608kb
  • [2024-09-15 01:44:40]
  • 提交

answer

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

a.sort(reverse=True)

happiness = 0

if n <= 200000:
  for i in range(n):
    if n % 2 == 0:
      if i + 1 <= n // 2 and i >= 0:
        happiness += a[i]
    else:
      if i + 1 <= n // 2 + 1 and i >= 0:
        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: 49
Accepted
time: 12ms
memory: 10608kb

input:

5
3 2 -1 4 5

output:

12

result:

ok single line: '12'

Test #2:

score: 49
Accepted
time: 9ms
memory: 10608kb

input:

1
10

output:

10

result:

ok single line: '10'

Test #3:

score: 49
Accepted
time: 15ms
memory: 10484kb

input:

6
1 -3 2 10 -4 9

output:

21

result:

ok single line: '21'

Test #4:

score: 0
Wrong Answer
time: 15ms
memory: 10520kb

input:

1
-983826926

output:

-983826926

result:

wrong answer 1st lines differ - expected: '0', found: '-983826926'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%