Problem sawmills
User ARock
Submission Time 2024-01-12 15:21:55
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sawmills.cpp: In function ‘int C(int, int)’:
sawmills.cpp:10:12: error: ‘start’ was not declared in this scope
10 | return start[L] + end[R];
| ^~~~~
sawmills.cpp:10:28: error: invalid types ‘<unresolved overloaded function type>[int]’ for array subscript
10 | return start[L] + end[R];
| ^
sawmills.cpp: In function ‘int32_t main()’:
sawmills.cpp:30:36: error: ‘start’ was not declared in this scope
30 | for (int i = 1; i <= N+1; i++) start[i] = start[i-1] + PS[i-1] * (D[i] - D[i-1]);
| ^~~~~
sawmills.cpp:31:39: error: invalid types ‘<unresolved overloaded function type>[int]’ for array subscript
31 | for (int i = N; i >= 1; i--) end[i] = (D[N+1] - D[i]) * (PS[N] - PS[i-1]);
| ^