Problem averyclassicsubsegmentproblem
User popperoni
Submission Time 2026-06-23 16:24:22
Score 0
Max Time N/A
Max Memory N/A

Compile Error

averyclassicsubsegmentproblem.cpp:15:11: error: conflicting declaration ‘const int n’
15 | const int n=1e5;
| ^
averyclassicsubsegmentproblem.cpp:14:5: note: previous declaration as ‘int n’
14 | int n;
| ^
averyclassicsubsegmentproblem.cpp:17:10: error: array bound is not an integer constant before ‘]’ token
17 | int arr[n];
| ^
averyclassicsubsegmentproblem.cpp: In function ‘int main()’:
averyclassicsubsegmentproblem.cpp:23:15: error: ‘arr’ was not declared in this scope
23 | for(int &i : arr){
| ^~~
averyclassicsubsegmentproblem.cpp:33:14: error: ‘arr’ was not declared in this scope
33 | cursum += arr[i];
| ^~~