prog.cpp:1:19: error: ‘vector’ does not name a type
void getAns(const vector<char> &arr, vector<vector<int>> &queries){
^~~~~~
prog.cpp:1:25: error: expected ‘,’ or ‘...’ before ‘<’ token
void getAns(const vector<char> &arr, vector<vector<int>> &queries){
^
prog.cpp: In function ‘void getAns(int)’:
prog.cpp:2:10: error: ‘arr’ was not declared in this scope
int n = arr.size();
^~~
prog.cpp:5:14: error: ‘INT_MAX’ was not declared in this scope
int start = INT_MAX, end = INT_MIN;
^~~~~~~
prog.cpp:5:14: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
prog.cpp:1:1:
+#include <climits>
void getAns(const vector<char> &arr, vector<vector<int>> &queries){
prog.cpp:5:14:
int start = INT_MAX, end = INT_MIN;
^~~~~~~
prog.cpp:10:12: error: ‘min’ was not declared in this scope
start = min(start, i);
^~~
prog.cpp:11:4: error: ‘end’ was not declared in this scope
end = max(end, i);
^~~
prog.cpp:11:10: error: ‘max’ was not declared in this scope
end = max(end, i);
^~~
prog.cpp:16:12: error: initializer in range-based ‘for’ loop
for(int i = start: i < end; i++){
^
prog.cpp:16:25: error: ‘end’ was not declared in this scope
for(int i = start: i < end; i++){
^~~
prog.cpp:16:28: error: expected ‘)’ before ‘;’ token
for(int i = start: i < end; i++){
~ ^
)
prog.cpp:16:30: error: ‘i’ was not declared in this scope
for(int i = start: i < end; i++){
^
prog.cpp:22:25: error: ‘end’ was not declared in this scope
for(int i = start; i < end; i++){
^~~
prog.cpp:32:13: error: ‘min’ was not declared in this scope
joinF += min(leftExit, rightExit);
^~~
prog.cpp:45:18: error: ‘queries’ was not declared in this scope
for(auto query: queries){ // query -> {x,y} {move food, clean dirty}
^~~~~~~
prog.cpp:45:18: note: suggested alternative: ‘query’
for(auto query: queries){ // query -> {x,y} {move food, clean dirty}
^~~~~~~
query
prog.cpp:50:3: error: ‘cout’ was not declared in this scope
cout << totalCost <<endl
^~~~
prog.cpp:50:23: error: ‘endl’ was not declared in this scope
cout << totalCost <<endl
^~~~
prog.cpp:50:23: note: suggested alternative: ‘enum’
cout << totalCost <<endl
^~~~
enum