Submission details
Task:Particle Accelerator II
Sender:Abduvohid
Submission time:2025-11-26 17:24:03 +0200
Language:Python2 (PyPy2)
Status:READY
Result:
Test results
testverdicttime
#10.03 sdetails
#20.03 sdetails
#30.03 sdetails
#40.03 sdetails
#50.03 sdetails
#60.03 sdetails
#70.03 sdetails
#80.03 sdetails
#90.04 sdetails
#100.03 sdetails
#110.04 sdetails
#120.04 sdetails
#130.07 sdetails

Code

n = int(input())
m = list(map(int, input().split()))

# sum the two first always, save the cost of it and print the sum of all costs
allCosts = []
while len(m) != 1:
    cost = m[0] * m[1]
    allCosts.append(cost)
    summed = m[0] + m[1]

    m.pop(0)
    m.pop(0) #remove the merged
    m.insert(0, summed)

print(sum(allCosts))

Test details

Test 1

Verdict:

input
2
5 10 

correct output
50

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 2

Verdict:

input
3
5 2 1 

correct output
17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 3

Verdict:

input
4
6 1 8 9 

correct output
197

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 4

Verdict:

input
5
10 10 6 2 10 

correct output
552

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 5

Verdict:

input
6
3 1 9 9 3 4 

correct output
322

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 6

Verdict:

input
7
9 10 4 3 9 1 1 

correct output
540

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 7

Verdict:

input
8
1 3 8 4 5 10 8 5 

correct output
816

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 8

Verdict:

input
9
9 1 10 3 9 4 6 9 3 

correct output
1251

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 9

Verdict:

input
10
1803 684 195 6648 4633 1942 72...

correct output
594464350

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 10

Verdict:

input
100
1542 4463 7401 8734 2634 865 5...

correct output
124146493451

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 11

Verdict:

input
1000
7778 6074 2376 8595 8243 8930 ...

correct output
12149459777256

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 12

Verdict:

input
10000
5140 9219 7732 6591 8705 3663 ...

correct output
1274117469101964

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...

Test 13

Verdict:

input
100000
8489 8136 1789 5914 544 1110 3...

correct output
125270679504052570

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 2, in <module>
    m = lis...