Problem penguingathering
User christal
Submission Time 2023-12-09 11:59:36
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 [1005]’
6 | int N[1005];
| ^
penguingathering.cpp:5:12: note: previous declaration as ‘int N’
5 | int K, A, N, diff;
| ^
penguingathering.cpp:9:11: error: ‘i’ was not declared in this scope
9 | cin >> N[i];
| ^
penguingathering.cpp:11:17: error: ‘X’ was not declared in this scope
11 | diff[i] = K - X[i];
| ^
penguingathering.cpp:13:9: error: no match for ‘operator>>’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘int’)
13 | cout >> min_diff;
| ~~~~ ^~ ~~~~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
penguingathering.cpp:13:9: note: candidate: ‘operator>>(int, int)’ <built-in>
13 | cout &g