elephants.cpp: In function 'void make_bucket(std::vector<int>&)':
elephants.cpp:20:38: error: 'pos' was not declared in this scope; did you mean 'pow'?
20 | while( posicao[ v[l] ] + L < pos[ v[r-1] ]) r--;
| ^~~
| pow
elephants.cpp: In function 'void assign_buckets()':
elephants.cpp:37:9: error: inconsistent deduction for 'auto': 'std::_Rb_tree_const_iterator<std::pair<int, int> >' and then 'int'
37 | for(auto it = eleph_in_order.begin(), id = 1; it != eleph_in_order.end(); ++it, ++id){
| ^~~~
elephants.cpp:39:36: error: 'i' was not declared in this scope; did you mean 'id'?
39 | buckets[myb[id]].push_back(i);
| ^
| id
elephants.cpp: In function 'int find_answer()':
elephants.cpp:53:30: error: 'pos' was not declared in this scope; did you mean 'pow'?
53 | while( i+1 < B_SZ && pos[ buckets[i+1][0] ] <= uc ) i++;
| ^~~
| pow
elephants.cpp:58:17: error: 'pos' was not declared in this scope; did you mean 'pow'?
58 | if( pos[ buckets[i][j+(1<<k)] ] <= uc ) j += (1<<k);
| ^~~
| pow
elephants.cpp: In function 'void init(int, int, int*)':
elephants.cpp:74:26: error: expected ';' before 'eleph_in_order'
74 | posicao[i] = X[i]
| ^
| ;
75 | eleph_in_order.insert({X[i], i});
| ~~~~~~~~~~~~~~
elephants.cpp:75:40: error: expected primary-expression before ')' token
75 | eleph_in_order.insert({X[i], i});
| ^
elephants.cpp: In function 'int update(int, int)':
elephants.cpp:100:64: error: expected ']' before ';' token
100 | myb[i] = myb[eleph_in_order.upper_bound({y, i})->second;];
| ^
| ]
elephants.cpp:100:65: error: expected primary-expression before ']' token
100 | myb[i] = myb[eleph_in_order.upper_bound({y, i})->second;];
| ^