Submission #647180

#TimeUsernameProblemLanguageResultExecution timeMemory
647180beaconmcGrowing Vegetables is Fun 4 (JOI21_ho_t1)C++14
Compilation error
0 ms0 KiB
n = int(input()) lis = list(map(int, input().split())) a = [0] b = [0] for i in range(len(lis)-1): a.append(a[-1] + max(0,lis[i]-lis[i+1]+1)) lis.reverse() for i in range(len(lis)-1): b.append(b[-1] + max(0,lis[i]-lis[i+1]+1)) b.reverse() print(min([max([a[i],b[i]]) for i in range(len(a))]))

Compilation message (stderr)

Main.cpp:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^