Submission #162370

# Submission time Handle Problem Language Result Execution time Memory
162370 2019-11-07T18:58:05 Z boolodifjenula Baloni (COCI15_baloni) Python 3
20 / 100
2000 ms 95132 KB
n=int(input())
L=list(map(int,input().split()))
s=0
g1=L[0]
m=sum(L)
while m:
    s+=1
    g=g1
    g1=0
    for i in range(n):
        if g==L[i]:
            g-=1
            m-=L[i]
            L[i]=0
        elif g1==0:
            g1=L[i]
        if g<1 and g1:
            break
print(s)
        
# Verdict Execution time Memory Grader output
1 Correct 309 ms 3416 KB Output is correct
2 Correct 809 ms 3648 KB Output is correct
3 Execution timed out 2052 ms 3648 KB Time limit exceeded
4 Execution timed out 2066 ms 3776 KB Time limit exceeded
5 Execution timed out 2071 ms 87844 KB Time limit exceeded
6 Execution timed out 2077 ms 95132 KB Time limit exceeded
7 Execution timed out 2070 ms 77856 KB Time limit exceeded
8 Execution timed out 2061 ms 77080 KB Time limit exceeded
9 Execution timed out 2076 ms 83728 KB Time limit exceeded
10 Execution timed out 2069 ms 85456 KB Time limit exceeded