Submission details
Task:Missing Coin Sum
Sender:banghalq
Submission time:2025-11-20 12:29:53 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#2ACCEPTED0.04 sdetails
#30.04 sdetails
#40.16 sdetails
#5ACCEPTED0.14 sdetails
#60.16 sdetails
#70.04 sdetails
#80.11 sdetails
#90.04 sdetails
#100.04 sdetails

Code

n = int(input())
array = [int(x) for x in input().split()]

array.sort()

val = 1
for i in range(n):
    if array[i] > val:
        break
    val += array[i]
    print(val)
print(val)

Test details

Test 1

Verdict:

input
4
2 1 4 3

correct output
11

user output
2
4
7
11
11

Feedback: Output is longer than expected

Test 2

Verdict: ACCEPTED

input
4
2 2 2 2

correct output
1

user output
1

Test 3

Verdict:

input
6
1 9 9 1 2 2

correct output
7

user output
2
3
5
7
7

Feedback: Output is longer than expected

Test 4

Verdict:

input
200000
38 62 12 96 82 18 48 47 22 3 6...

correct output
10114269

user output
2
3
4
5
6
...

Feedback: Output is longer than expected

Test 5

Verdict: ACCEPTED

input
200000
321076699 332784673 745614086 ...

correct output
1

user output
1

Test 6

Verdict:

input
200000
1 136292223 60613622 935902310...

correct output
5069547

user output
2
3
4
5
6
...

Feedback: Output is longer than expected

Test 7

Verdict:

input
60
1 2 4 8 16 32 64 128 256 512 1...

correct output
31073741824

user output
2
4
8
16
32
...

Feedback: Output is longer than expected

Test 8

Verdict:

input
100000
1 2 4 8 16 32 64 128 256 512 1...

correct output
53672058814464

user output
2
4
8
16
32
...

Feedback: Output is longer than expected

Test 9

Verdict:

input
10
1 1 1 1 1 1 1 1 2 7

correct output
18

user output
2
3
4
5
6
...

Feedback: Output is longer than expected

Test 10

Verdict:

input
2
1 1

correct output
3

user output
2
3
3

Feedback: Output is longer than expected