Problem monsters2
User j0ashhh
Submission Time 2026-03-13 16:51:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

monsters2.cpp: In function ‘int closest(std::vector<int>, int)’:
monsters2.cpp:6:12: error: ‘a’ was not declared in this scope
6 | if (it != a.end())
| ^
monsters2.cpp:9:15: error: ‘a’ was not declared in this scope
9 | if (it != a.begin())
| ^
monsters2.cpp: In function ‘int main()’:
monsters2.cpp:32:27: error: ‘cost’ cannot be used as a function
32 | int comp = cost(mines, x);
| ^
monsters2.cpp:39:15: error: no match for ‘operator+=’ (operand types are ‘std::basic_ostream<char>’ and ‘int’)
39 | cout << cost += k;
| ~~~~~~~~~~~~~^~~~