Problem penguingathering
User blob
Submission Time 2023-12-09 11:34:11
Score 0
Max Time N/A
Max Memory N/A

Compile Error

penguingathering.cpp: In function ‘int main()’:
penguingathering.cpp:16:13: error: expected initializer before ‘==’ token
16 | int median == N/2;
| ^~
penguingathering.cpp:18:12: error: lvalue required as left operand of assignment
18 | if (N%2 = 0){
| ^
penguingathering.cpp:19:3: error: ‘median’ was not declared in this scope
19 | median = penguins [N / 2 - 1];
| ^~~~~~
penguingathering.cpp:22:3: error: ‘median’ was not declared in this scope
22 | median = penguins[N / 2];
| ^~~~~~
penguingathering.cpp:28:29: error: ‘median’ was not declared in this scope
28 | minAnnoyance += abs(median - penguins[i]);
| ^~~~~~