Submission #1649735


Source Code Expand

Copy
N = int(input())
A = [int(input()) for i in range(N)]
V = 1
ans = 0
for i in range(N):
    #print(V, ans)
    if(A[i] > V):
        t = (A[i]-1)//V
        ans += t
        A[i] -= V*t
        if(A[i]+1 > V):
            A[i] = 1
    V = max(V,A[i]+1)
    
print(ans)

Submission Info

Submission Time
Task D - Greedy customers
User TAB
Language C++14 (GCC 5.4.1)
Score 0
Code Size 283 Byte
Status

Compile Error

./Main.cpp:6:6: error: invalid preprocessing directive #print
     #print(V, ans)
      ^
./Main.cpp:1:1: error: ‘N’ does not name a type
 N = int(input())
 ^