Problem mountains
User YH
Submission Time 2025-01-27 10:35:03
Score 0
Max Time N/A
Max Memory N/A

Compile Error

mountains.cpp: In function ‘int main()’:
mountains.cpp:66:47: error: invalid initialization of reference of type ‘std::vector<int>&’ from expression of type ‘std::vector<long long int>’
66 | update(1, 0, m - 1, indexes[heights[i]], 1, tree_right);
| ^~~~~~~~~~
mountains.cpp:9:70: note: in passing argument 6 of ‘void update(int, int, int, int, int, std::vector<int>&)’
9 | void update(int node, int tl, int tr, int idx, int val, vector<int> &tree) {
| ~~~~~~~~~~~~~^~~~
mountains.cpp:72:51: error: invalid initialization of reference of type ‘std::vector<int>&’ from expression of type ‘std::vector<long long int>’
72 | update(1, 0, m - 1, indexes[heights[i - 1]], 1, tree_left);
| ^~~~~~~~~
mountains.cpp:9:70: note: in passing argument 6 of ‘void