Problem potatosalad
User GanJaeHan
Submission Time 2026-01-28 17:23:42
Score 0
Max Time N/A
Max Memory N/A

Compile Error

potatosalad.cpp: In function ‘int main()’:
potatosalad.cpp:6:35: error: invalid types ‘int[int]’ for array subscript
6 | int a = sizeof(M) / sizeof(M[0]);
| ^
potatosalad.cpp:8:5: error: ‘sort’ was not declared in this scope; did you mean ‘qsort’?
8 | sort(M, M + a, greater<int>());
| ^~~~
| qsort
potatosalad.cpp:11:45: error: invalid types ‘int[int]’ for array subscript
11 | for (int i = 0; i < sizeof(M)/sizeof(M[0]); i++){
| ^
potatosalad.cpp:13:14: error: invalid types ‘int[int]’ for array subscript
13 | ans += i[M];
| ^