Problem monsters2
User epignhan97
Submission Time 2025-03-25 21:52:03
Score 0
Max Time N/A
Max Memory N/A

Compile Error

monsters2.cpp: In function ‘int main()’:
monsters2.cpp:8:5: error: expected ‘,’ or ‘;’ before ‘vector’
8 | vector<pair<int, int>> monsters(n); // (position, health)
| ^~~~~~
monsters2.cpp:12:16: error: ‘monsters’ was not declared in this scope
12 | cin >> monsters[i].first >> monsters[i].second;
| ^~~~~~~~
monsters2.cpp:19:20: error: ‘monsters’ was not declared in this scope
19 | if (abs(mines[0]-monsters[ij].first) < monsters[ij].second){
| ^~~~~~~~
monsters2.cpp:22:3: error: ‘s’ was not declared in this scope
22 | s+= min(abs(mines[0]-monsters[ij].first),monsters[ij].second);
| ^
monsters2.cpp:22:24: error: ‘monsters’ was not declared in this scope
22 | s+= min(abs(mines[0]-monsters[ij].first),monsters[ij].second);
| ^~~~~~~~
monsters2.cpp:25:13: error: ‘total_cost’ was not declared in