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 = list(map(int, input().split()))
  File "<string>", line 1
    5 10
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    5 2 1
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    6 1 8 9
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    10 10 6 2 10
       ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    3 1 9 9 3 4
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    9 10 4 3 9 1 1
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    1 3 8 4 5 10 8 5
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    9 1 10 3 9 4 6 9 3
      ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    1803 684 195 6648 4633 1942 7250 9263 4203 1052
         ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    1542 4463 7401 8734 2634 865 5338 7237 146 3505 9188 340 9008 2955 335 826 9570 7260 1373 3729 2839 6760 6061 9837 9443 4816 8528 9126 23 1899 5213 1480 5521 9073 4854 6844 7682 9578 1608 4561 7646 5632 209 8013 1353 9432 1163 2234 3099 7030 6715 5000 4713 2027 8162 6294 2896 1443 7332 530 7027 1644 3276 8663 3347 375 9781 2177 6246 9866 9504 1729 7675 1217 8251 5455 4067 4218 4514 6083 4007 7895 9952 9268 1776 2686 9626 3043 4193 7376 4241 9290 4632 206 3738 9362 4656 5708 352 1524
         ^
SyntaxError: invalid syntax

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 = list(map(int, input().split()))
  File "<string>", line 1
    7778 6074 2376 8595 8243 8930 9658 1792 9727 7586 4535 7517 6091 6074 7756 7941 6417 3881 7221 3404 351 6620 2985 9056 586 7201 8571 4716 3729 4971 6799 4463 2563 5306 3476 9933 95 6145 3584 1804 9491 7229 2179 9392 3194 5384 9178 4702 320 6245 651 6898 6299 2888 8739 529 88 7877 7466 5259 8129 1969 758 5953 6565 5431 5093 4515 4799 5116 9556 6682 1 1184 2470 1116 7123 8367 3246 2720 2770 6182 6955 5897 9186 6866 2445 3003 4581 6240 2530 890 3794 5377 6046 668 7724 2798 680 1112 6861 5433 5483 6256 1380 4970 988 7144 2456 2064 1518 9928 9260 1778 6802 9959 2377 5337 5689 909 5567 2756 728 1860 8398 4504 4054 4241 1449 30 1910 5039 4907 4625 7121 7925 9850 125 8748 7480 4991 9905 1068 1897 9133 1347 3650 1811 2266 298 8725 3989 1364 1670 2364 400 5955 9642 5640 3584 9590 271 4533 5456 1290 7772 7606 5660 2017 4492 1758 9823 4372 5259 3403 8...

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 = list(map(int, input().split()))
  File "<string>", line 1
    5140 9219 7732 6591 8705 3663 81 1491 3098 2013 9577 2220 5132 3195 3183 3642 5393 5391 2213 6815 8065 5350 3423 2475 5389 9664 59 1515 6732 2190 2101 2946 9326 3454 3743 9914 7525 2266 7632 9759 8706 1119 1102 1731 3001 7995 4750 9200 6730 5344 2576 966 7012 1177 6571 2651 1821 7185 3221 1705 8876 9829 834 269 7466 116 624 9153 7315 8835 7426 815 4080 6968 9914 6900 4522 9835 1899 6546 3517 1899 7149 8155 3575 3626 517 399 3160 9962 9989 6802 2880 7354 4618 6613 7353 3272 9437 7305 1755 1838 2125 4524 1325 2211 2087 4998 9957 7137 2467 1807 1101 9080 5024 1084 4562 7306 7345 7674 6210 3326 6211 7547 1502 7696 5383 6024 1204 5953 1531 8918 4502 899 4291 5898 7337 6099 736 2947 2788 6694 1653 8769 5081 5680 5793 6409 6387 2095 2141 7701 4176 2350 4669 7183 831 3869 5703 586 2286 690 358 8112 9646 3122 747 3996 7305 2763 5027 3719 927 8332 5...

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 = list(map(int, input().split()))
  File "<string>", line 1
    8489 8136 1789 5914 544 1110 3616 8187 2755 9267 5301 250 3060 8223 3045 7200 1118 2122 2499 8725 9177 325 2642 5021 7178 5509 8658 9845 8071 4224 2106 8336 1673 7060 468 7747 395 1166 2003 3637 9986 8235 3728 2592 7606 875 4735 9631 5098 2737 9451 2281 1095 4777 4651 3462 1416 3704 5384 7284 2990 3506 5378 5933 6657 8211 3644 8573 6231 5888 6428 8267 4200 6948 4033 3261 3905 1337 4062 8437 797 6641 569 7331 784 5890 6957 1640 292 4836 4995 7293 1327 7825 308 2578 6395 1484 4460 523 9747 3401 3298 2148 1955 7665 6841 4638 3511 9258 7711 3384 7919 1054 4439 8694 2689 8170 240 2174 3714 3098 978 6229 7276 5389 4595 9109 5205 2810 6846 5977 4253 1746 6035 6616 8239 5519 4519 3278 8880 4712 2204 646 1069 6129 121 7750 9180 9642 6366 9953 2198 3521 5476 6049 9209 6972 8757 2332 1276 1483 3037 530 2953 9397 5692 1458 7435 6176 3301 3725 6079 655...