train.cpp: In function 'bool check(std::pair<long long int, long long int>&, std::pair<long long int, long long int>&, ll&, ll&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)':
train.cpp:76:30: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
76 | ll lans1 = a.first + f(a.second, x, tr, tmp2) * w;
| ~~^~~~~~
train.cpp:64:18: note: initializing argument 1 of 'll f(int&, int&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
64 | inline ll f(int &l, int &r, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~^
train.cpp:77:30: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
77 | ll lans2 = b.first + f(b.second, x, tr, tmp2) * w;
| ~~^~~~~~
train.cpp:64:18: note: initializing argument 1 of 'll f(int&, int&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
64 | inline ll f(int &l, int &r, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~^
train.cpp: In function 'long long int solve(int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:124:51: error: cannot bind non-const lvalue reference of type 'std::pair<long long int, long long int>&' to an rvalue of type 'std::pair<long long int, long long int>'
124 | while (ans_end[j].size() > 0 && check(ans_end[j].back().second, {lans, i.first.first}, ans_end[j].back().first, t[j], tr, tmp2)) {
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/vector:60,
from train.h:1,
from train.cpp:1:
/usr/include/c++/11/bits/stl_pair.h:352:19: note: after user-defined conversion: 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = long long int&; _U2 = long long int&; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = long long int; _T2 = long long int]'
352 | constexpr pair(_U1&& __x, _U2&& __y)
| ^~~~
train.cpp:75:50: note: initializing argument 2 of 'bool check(std::pair<long long int, long long int>&, std::pair<long long int, long long int>&, ll&, ll&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
75 | inline bool check(pair<ll, ll> &a, pair<ll, ll> &b, ll &x, ll &w, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~~~~~~~~~~^
train.cpp:131:23: error: cannot bind non-const lvalue reference of type 'std::pair<long long int, long long int>&' to an rvalue of type 'std::pair<long long int, long long int>'
131 | if (!check(ans_end[j].back().second, {lans, i.first.first}, tmp.size() - 1, t[j], tr, tmp2)) continue;
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/vector:60,
from train.h:1,
from train.cpp:1:
/usr/include/c++/11/bits/stl_pair.h:352:19: note: after user-defined conversion: 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = long long int&; _U2 = long long int&; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = long long int; _T2 = long long int]'
352 | constexpr pair(_U1&& __x, _U2&& __y)
| ^~~~
train.cpp:75:50: note: initializing argument 2 of 'bool check(std::pair<long long int, long long int>&, std::pair<long long int, long long int>&, ll&, ll&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
75 | inline bool check(pair<ll, ll> &a, pair<ll, ll> &b, ll &x, ll &w, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~~~~~~~~~~^
train.cpp:135:26: error: cannot bind non-const lvalue reference of type 'std::pair<long long int, long long int>&' to an rvalue of type 'std::pair<long long int, long long int>'
135 | if (check(ans_end[j].back().second, {lans, i.first.first}, mid, t[j], tr, tmp2)) {
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/vector:60,
from train.h:1,
from train.cpp:1:
/usr/include/c++/11/bits/stl_pair.h:352:19: note: after user-defined conversion: 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = long long int&; _U2 = long long int&; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = long long int; _T2 = long long int]'
352 | constexpr pair(_U1&& __x, _U2&& __y)
| ^~~~
train.cpp:75:50: note: initializing argument 2 of 'bool check(std::pair<long long int, long long int>&, std::pair<long long int, long long int>&, ll&, ll&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
75 | inline bool check(pair<ll, ll> &a, pair<ll, ll> &b, ll &x, ll &w, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~~~~~~~~~~^
train.cpp:155:60: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
155 | lans = lans2.second.first + f(lans2.second.second, i.first.first, tr, tmp2) * t[j];
| ~~~~~~~~~~~~~^~~~~~
train.cpp:64:18: note: initializing argument 1 of 'll f(int&, int&, PersSegTree&, std::vector<std::pair<long long int, long long int> >&)'
64 | inline ll f(int &l, int &r, PersSegTree &tr, vector<pair<ll, ll>> &tmp2) {
| ~~~~~^
train.cpp:173:1: warning: control reaches end of non-void function [-Wreturn-type]
173 | }
| ^