# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1164828 | SmuggingSpun | 송신탑 (IOI22_towers) | C++20 | Compilation error | 0 ms | 0 KiB |
#include "towers.h"
#include<bits/stdc++.h>
using namespace std;
const int lim = 1e5 + 5;
const int INF = 2e9;
template<class T>void maximize(T& a, T b){
if(a < b){
a = b;
}
}
struct Node{
int cnt, l, r;
Node(){
this->cnt = 0;
this->l = this->r = -1;
}
};
int n, l_min[lim], r_min[lim], h[lim], log_v[lim], spt[lim][17];
vector<Node>st;
vector<pair<int, int>>a(1, make_pair(INF, -1));
int get_max(int l, int r){
int k = log_v[r - l + 1];
return max(spt[l][k], spt[r - (1 << k) + 1][k]);
}
void update(int id, int p){
int l = 1, r = n;
while(l < r){
st[id].cnt++;
int m = (l + r) >> 1;
if(m < p){
st.emplace_back(st[st[id].r]);
st[id].r = int(st.size()) - 1;
id = st[id].r;
l = m + 1;
}
else{
st.emplace_back(st[st[id].l]);
st[id].l = int(st.size()) - 1;
id = st[id].l;
r = m;
}
}
st[id].cnt++;
}
void build(int id = 0, int l = 1, int r = n){
if(l == r){
return;
}
st[id].l = st.size();
st.emplace_back(Node());
st[id].r = st.size();
st.emplace_back(Node());
int m = (l + r) >> 1;
build(st[id].l, l, m);
build(st[id].r, m + 1, r);
}
void init(int N, vector<int>H){
log_v[0] = -1;
for(int i = 1; i < lim; i++){
log_v[i] = log_v[i >> 1] + 1;
}
n = N;
for(int i = 0; i < n; i++){
spt[i + 1][0] = h[i + 1] = H[i];
}
for(int j = 1; j < 17; j++){
for(int i = 1; i + (1 << j) - 1 <= n; i++){
spt[i][j] = max(spt[i][j - 1], spt[i + (1 << (j - 1))][j - 1]);
}
}
stack<int>stk;
for(int i = 1; i <= n; stk.push(i++)){
while(!stk.empty() && h[i] < h[stk.top()]){
stk.pop();
}
l_min[i] = (stk.empty() ? 0 : stk.top());
}
while(!stk.empty()){
stk.pop();
}
for(int i = n; i > 0; stk.push(i--)){
while(!stk.empty() && h[i] < h[stk.top()]){
stk.pop();
}
r_min[i] = (stk.empty() ? n + 1 : stk.top());
}
for(int i = 1; i <= n; i++){
a.emplace_back(min(l_min[i] == 0 ? INF : get_max(l_min[i] + 1, i), r_min[i] == n + 1 ? INF : get_max(i, r_min[i] - 1)) - h[i], i);
}
sort(a.begin(), a.end(), greater<pair<int, int>>());
st.assign(n + 1, Node());
build();
for(int i = 1; i <= n; i++){
st[i] = st[i - 1];
update(i, a[i].second);
}
}
int get(int id, int l, int r, int u, int v){
if(l > v || r < u){
return 0;
}
if(u <= l && v >= r){
return st[id].cnt;
}
int m = (l + r) >> 1;
return max(get(st[id].l, l, m, u, v), get(st[id].r, m + 1, r, u, v));
}
int max_towers(int l, int r, int d){
int low = 1, high = n, id = 0;
while(low <= high){
int mid = (low + high) >> 1;
if(a[mid].first >= d){
low = (id = mid) + 1;
}
else{
high = mid - 1;
}
}
if(get(id, 1, n, 1, n) < 2){
return 1;
}
low = l;
high = r;
int L, R;
while(low <= high){
int mid = (low + high) >> 1;
if(get(id, l, mid) > 0){
high = (L = mid) - 1;
}
else{
low = mid + 1;
}
}
low = l;
high = r;
while(low <= high){
int mid = (low + high) >> 1;
if(get(id, mid, r) > 0){
low = (R = mid) + 1;
}
else{
high = mid - 1;
}
}
return st[id].cnt;
}
Compilation message (stderr)
towers.cpp: In function 'int max_towers(int, int, int)': towers.cpp:127:15: error: no matching function for call to 'get(int&, int&, int&)' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:223:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type& std::get(std::pair<_OIter1, _OIter2>&)' 223 | get(pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/11/utility:223:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_OIter1, _OIter2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:228:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type&& std::get(std::pair<_OIter1, _OIter2>&&)' 228 | get(pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/11/utility:228:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_OIter1, _OIter2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:233:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type& std::get(const std::pair<_OIter1, _OIter2>&)' 233 | get(const pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/11/utility:233:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_OIter1, _OIter2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:238:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type&& std::get(const std::pair<_OIter1, _OIter2>&&)' 238 | get(const pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/11/utility:238:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_OIter1, _OIter2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:247:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_T1, _T2>&)' 247 | get(pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/11/utility:247:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:252:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_T1, _T2>&)' 252 | get(const pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/11/utility:252:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:257:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_T1, _T2>&&)' 257 | get(pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:257:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:262:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_T1, _T2>&&)' 262 | get(const pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:262:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:267:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_Up, _Tp>&)' 267 | get(pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/11/utility:267:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:272:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_Up, _Tp>&)' 272 | get(const pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/11/utility:272:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_Up, _Tp>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:277:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_Up, _Tp>&&)' 277 | get(pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:277:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:282:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_Up, _Tp>&&)' 282 | get(const pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:282:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::pair<_Up, _Tp>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/ranges_algo.h:36, from /usr/include/c++/11/algorithm:64, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/bits/ranges_util.h:381:5: note: candidate: 'template<long unsigned int _Num, class _It, class _Sent, std::ranges::subrange_kind _Kind> requires _Num < 2 constexpr auto std::ranges::get(std::ranges::subrange<_It, _Sent, _Kind>&&)' 381 | get(subrange<_It, _Sent, _Kind>&& __r) | ^~~ /usr/include/c++/11/bits/ranges_util.h:381:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::ranges::subrange<_It, _Sent, _Kind>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/ranges_algo.h:36, from /usr/include/c++/11/algorithm:64, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/bits/ranges_util.h:370:5: note: candidate: 'template<long unsigned int _Num, class _It, class _Sent, std::ranges::subrange_kind _Kind> requires _Num < 2 constexpr auto std::ranges::get(const std::ranges::subrange<_It, _Sent, _Kind>&)' 370 | get(const subrange<_It, _Sent, _Kind>& __r) | ^~~ /usr/include/c++/11/bits/ranges_util.h:370:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::ranges::subrange<_It, _Sent, _Kind>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:361:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(std::array<_Tp, _Nm>&)' 361 | get(array<_Tp, _Nm>& __arr) noexcept | ^~~ /usr/include/c++/11/array:361:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:369:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(std::array<_Tp, _Nm>&&)' 369 | get(array<_Tp, _Nm>&& __arr) noexcept | ^~~ /usr/include/c++/11/array:369:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:377:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&)' 377 | get(const array<_Tp, _Nm>& __arr) noexcept | ^~~ /usr/include/c++/11/array:377:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:385:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const std::array<_Tp, _Nm>&&)' 385 | get(const array<_Tp, _Nm>&& __arr) noexcept | ^~~ /usr/include/c++/11/array:385:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1393:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(std::tuple<_UTypes ...>&)' 1393 | get(tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1393:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1399:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(const std::tuple<_UTypes ...>&)' 1399 | get(const tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1399:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1405:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(std::tuple<_UTypes ...>&&)' 1405 | get(tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1405:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1414:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(const std::tuple<_UTypes ...>&&)' 1414 | get(const tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1414:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1449:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::tuple<_UTypes ...>&)' 1449 | get(tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1449:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1460:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::tuple<_UTypes ...>&&)' 1460 | get(tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1460:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1471:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::tuple<_UTypes ...>&)' 1471 | get(const tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1471:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1483:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const std::tuple<_UTypes ...>&&)' 1483 | get(const tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1483:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1676:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >& std::get(std::variant<_Types ...>&)' 1676 | get(variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1676:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1687:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >&& std::get(std::variant<_Types ...>&&)' 1687 | get(variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1687:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1698:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >& std::get(const std::variant<_Types ...>&)' 1698 | get(const variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1698:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1709:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >&& std::get(const std::variant<_Types ...>&&)' 1709 | get(const variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1709:5: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1117:20: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::variant<_Types ...>&)' 1117 | constexpr _Tp& get(variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1117:20: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1126:21: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::variant<_Types ...>&&)' 1126 | constexpr _Tp&& get(variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1126:21: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1136:26: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::variant<_Types ...>&)' 1136 | constexpr const _Tp& get(const variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1136:26: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1145:27: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const std::variant<_Types ...>&&)' 1145 | constexpr const _Tp&& get(const variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1145:27: note: template argument deduction/substitution failed: towers.cpp:127:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 127 | if(get(id, l, mid) > 0){ | ~~~^~~~~~~~~~~~ towers.cpp:98:5: note: candidate: 'int get(int, int, int, int, int)' 98 | int get(int id, int l, int r, int u, int v){ | ^~~ towers.cpp:98:5: note: candidate expects 5 arguments, 3 provided towers.cpp:138:15: error: no matching function for call to 'get(int&, int&, int&)' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:223:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type& std::get(std::pair<_OIter1, _OIter2>&)' 223 | get(pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/11/utility:223:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_OIter1, _OIter2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:228:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type&& std::get(std::pair<_OIter1, _OIter2>&&)' 228 | get(pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/11/utility:228:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_OIter1, _OIter2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:233:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type& std::get(const std::pair<_OIter1, _OIter2>&)' 233 | get(const pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/11/utility:233:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_OIter1, _OIter2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:238:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_OIter1, _OIter2> >::type&& std::get(const std::pair<_OIter1, _OIter2>&&)' 238 | get(const pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/11/utility:238:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_OIter1, _OIter2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:247:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_T1, _T2>&)' 247 | get(pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/11/utility:247:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:252:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_T1, _T2>&)' 252 | get(const pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/11/utility:252:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:257:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_T1, _T2>&&)' 257 | get(pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:257:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:262:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_T1, _T2>&&)' 262 | get(const pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:262:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:267:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_Up, _Tp>&)' 267 | get(pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/11/utility:267:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:272:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_Up, _Tp>&)' 272 | get(const pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/11/utility:272:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_Up, _Tp>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:277:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_Up, _Tp>&&)' 277 | get(pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:277:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/utility:282:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_Up, _Tp>&&)' 282 | get(const pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/11/utility:282:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::pair<_Up, _Tp>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/ranges_algo.h:36, from /usr/include/c++/11/algorithm:64, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/bits/ranges_util.h:381:5: note: candidate: 'template<long unsigned int _Num, class _It, class _Sent, std::ranges::subrange_kind _Kind> requires _Num < 2 constexpr auto std::ranges::get(std::ranges::subrange<_It, _Sent, _Kind>&&)' 381 | get(subrange<_It, _Sent, _Kind>&& __r) | ^~~ /usr/include/c++/11/bits/ranges_util.h:381:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::ranges::subrange<_It, _Sent, _Kind>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/ranges_algo.h:36, from /usr/include/c++/11/algorithm:64, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/bits/ranges_util.h:370:5: note: candidate: 'template<long unsigned int _Num, class _It, class _Sent, std::ranges::subrange_kind _Kind> requires _Num < 2 constexpr auto std::ranges::get(const std::ranges::subrange<_It, _Sent, _Kind>&)' 370 | get(const subrange<_It, _Sent, _Kind>& __r) | ^~~ /usr/include/c++/11/bits/ranges_util.h:370:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::ranges::subrange<_It, _Sent, _Kind>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:361:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(std::array<_Tp, _Nm>&)' 361 | get(array<_Tp, _Nm>& __arr) noexcept | ^~~ /usr/include/c++/11/array:361:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:369:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(std::array<_Tp, _Nm>&&)' 369 | get(array<_Tp, _Nm>&& __arr) noexcept | ^~~ /usr/include/c++/11/array:369:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:377:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&)' 377 | get(const array<_Tp, _Nm>& __arr) noexcept | ^~~ /usr/include/c++/11/array:377:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/array:385:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const std::array<_Tp, _Nm>&&)' 385 | get(const array<_Tp, _Nm>&& __arr) noexcept | ^~~ /usr/include/c++/11/array:385:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1393:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(std::tuple<_UTypes ...>&)' 1393 | get(tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1393:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1399:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(const std::tuple<_UTypes ...>&)' 1399 | get(const tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1399:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1405:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(std::tuple<_UTypes ...>&&)' 1405 | get(tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1405:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1414:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(const std::tuple<_UTypes ...>&&)' 1414 | get(const tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1414:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1449:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::tuple<_UTypes ...>&)' 1449 | get(tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1449:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1460:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::tuple<_UTypes ...>&&)' 1460 | get(tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1460:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1471:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::tuple<_UTypes ...>&)' 1471 | get(const tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1471:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:54, from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/11/algorithm:74, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from towers.cpp:2: /usr/include/c++/11/tuple:1483:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const std::tuple<_UTypes ...>&&)' 1483 | get(const tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/11/tuple:1483:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1676:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >& std::get(std::variant<_Types ...>&)' 1676 | get(variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1676:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1687:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >&& std::get(std::variant<_Types ...>&&)' 1687 | get(variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1687:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1698:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >& std::get(const std::variant<_Types ...>&)' 1698 | get(const variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1698:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1709:5: note: candidate: 'template<long unsigned int _Np, class ... _Types> constexpr std::variant_alternative_t<_Np, std::variant<_Types ...> >&& std::get(const std::variant<_Types ...>&&)' 1709 | get(const variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1709:5: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1117:20: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::variant<_Types ...>&)' 1117 | constexpr _Tp& get(variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1117:20: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1126:21: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::variant<_Types ...>&&)' 1126 | constexpr _Tp&& get(variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1126:21: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1136:26: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::variant<_Types ...>&)' 1136 | constexpr const _Tp& get(const variant<_Types...>& __v) | ^~~ /usr/include/c++/11/variant:1136:26: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from towers.cpp:2: /usr/include/c++/11/variant:1145:27: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const std::variant<_Types ...>&&)' 1145 | constexpr const _Tp&& get(const variant<_Types...>&& __v) | ^~~ /usr/include/c++/11/variant:1145:27: note: template argument deduction/substitution failed: towers.cpp:138:15: note: mismatched types 'const std::variant<_Types ...>' and 'int' 138 | if(get(id, mid, r) > 0){ | ~~~^~~~~~~~~~~~ towers.cpp:98:5: note: candidate: 'int get(int, int, int, int, int)' 98 | int get(int id, int l, int r, int u, int v){ | ^~~ towers.cpp:98:5: note: candidate expects 5 arguments, 3 provided