Problem penguingathering
User christal
Submission Time 2023-12-09 10:46:33
Score 0
Max Time N/A
Max Memory N/A

Compile Error

penguingathering.cpp: In function ‘int main()’:
penguingathering.cpp:6:6: error: conflicting declaration ‘int N [i]’
6 | int N[i];
| ^
penguingathering.cpp:5:15: note: previous declaration as ‘int N’
5 | int K, A, X, N, i, diff;
| ^
penguingathering.cpp:8:12: error: invalid types ‘int[int]’ for array subscript
8 | cin >> X[i];
| ^
penguingathering.cpp:10:9: error: invalid types ‘int[int]’ for array subscript
10 | diff[i] = K - X[i];
| ^
penguingathering.cpp:10:20: error: invalid types ‘int[int]’ for array subscript
10 | diff[i] = K - X[i];
| ^
penguingathering.cpp:11:28: error: invalid types ‘int[int]’ for array subscript
11 | int min_diff = min(diff[i], diff[i-1])
| ^
penguingathering.cpp:11:39: error: invalid types ‘int[int]’ for array subscript
11 | int min_diff = m