# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1209668 | abczz | Bodyguard (JOI21_bodyguard) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include <iostream>
#include <map>
#include <set>
#define ll long long
#define ld long double
using namespace std;
map <ll, ll> mp, mp2;
array <ll, 4> A[2800];
vector <ll> X, Y;
vector <array<ll, 3>> VR[2800], VC[2800];
vector <ll> Q[5600][5600];
ll n, q, t, a, b, c, x, y, f, R[5600][5600], U[5600][5600], dp[5605][5605], F[3000000], QX[3000000], QY[3000000];
struct Line{
mutable ll m, c;
mutable ld d;
bool operator<(const Line &o) const {return m < o.m;}
bool operator<(ld x) {return d < x; }
};
struct LineContainer : multiset<Line, less<>> {
ld eps = 1e-8;
bool isect(iterator x, iterator y) {
if (y == end()) {
x->d = 1e18;
return 0;
}
if (x->m == y->m) x->d = x->c > y-> c ? 1e18 : -1e18;
else x->d = (ld)(y->c - x->c)/(x->m - y->m);
return (x->d > y->d || abs(x->d - y->d) < eps);
}
void add(ll m, ll c) {
auto z = insert({m, c, 0}), y = z++, x = y;
while (isect(y, z)) z = erase(z);
if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
while ((y = x) != begin() && (--x)->d >= y->d) isect(x, erase(y));
}
ll query(ll x) {
if (empty()) return 0;
auto l = *lower_bound(x);
return l.m * x + l.c;
}
}LC;
struct SegTree{
ll st[22400], lazy[22400];
void init(ll sz) {
for (int i=0; i<4*sz; ++i) st[i] = lazy[i] = 0;
}
void push(ll id) {
st[id*2] = max(st[id*2], lazy[id]);
st[id*2+1] = max(st[id*2+1], lazy[id]);
lazy[id*2] = max(lazy[id*2], lazy[id]);
lazy[id*2+1] = max(lazy[id*2+1], lazy[id]);
lazy[id] = 0;
}
void update(ll id, ll l, ll r, ll ql, ll qr, ll w) {
if (qr < l || r < ql) return;
else if (ql <= l && r <= qr) {
st[id] = max(st[id], w);
lazy[id] = max(lazy[id], w);
return;
}
push(id);
ll mid = (l+r)/2;
update(id*2, l, mid, ql, qr, w);
update(id*2+1, mid+1, r, ql, qr, w);
}
void solve(ll id, ll l, ll r, ll ty, ll i) {
if (l == r) {
if (!ty) R[i][l] = st[id];
else U[l][i] = st[id];
return;
}
ll mid = (l+r)/2;
push(id);
solve(id*2, l, mid, ty, i);
solve(id*2+1, mid+1, r, ty, i);
}
}ST;
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
cin >> n >> q;
for (int i=0; i<n; ++i) {
for (int j=0; j<4; ++j) cin >> A[i][j];
++mp[A[i][0]+A[i][1]];
++mp2[A[i][0]-A[i][1]];
++mp[A[i][0]+abs(A[i][1]-A[i][2])+A[i][2]];
++mp2[A[i][0]+abs(A[i][1]-A[i][2])-A[i][2]];
}
for (auto [x, y] : mp) X.push_back(x), mp[x] = X.size()-1;
for (auto [x, y] : mp2) Y.push_back(x), mp2[x] = Y.size()-1;
for (int i=0; i<n; ++i) {
if (A[i][1] < A[i][2]) {
VR[mp2[A[i][0]-A[i][1]]].push_back({mp[A[i][0]+A[i][1]], mp[A[i][0]+abs(A[i][1]-A[i][2])+A[i][2]]-1, A[i][3]});
}
else {
VC[mp[A[i][0]+A[i][1]]].push_back({mp2[A[i][0]-A[i][1]], mp2[A[i][0]+abs(A[i][1]-A[i][2])-A[i][2]]-1, A[i][3]});
}
}
for (int i=0; i<mp2.size(); ++i) {
ST.init(mp.size());
for (auto [l, r, w] : VR[i]) {
ST.update(1, 0, mp.size()-1, l, r, w);
}
ST.solve(1, 0, mp.size()-1, 0, i);
}
for (int i=0; i<mp.size(); ++i) {
ST.init(mp2.size());
for (auto [l, r, w] : VC[i]) {
ST.update(1, 0, mp2.size()-1, l, r, w);
}
ST.solve(1, 0, mp2.size()-1, 1, i);
}
for (int i=mp2.size()-1; i>=0; --i) {
for (int j=mp.size()-1; j>=0; --j) {
if (j != mp.size()-1) dp[i][j] = max(dp[i][j], dp[i][j+1] + R[i][j] * (X[j+1]-X[j])/2);
if (i != mp2.size()-1) dp[i][j] = max(dp[i][j], dp[i+1][j] + U[i][j] * (Y[i+1]-Y[i])/2);
}
}
for (int i=0; i<q; ++i) {
cin >> a >> b;
QX[i] = a+b, QY[i] = a-b;
auto it = lower_bound(X.begin(), X.end(), QX[i]);
auto it2 = lower_bound(Y.begin(), Y.end(), QY[i]);
if (it == X.end() || it2 == Y.end()) continue;
a = it2-Y.begin(), b = it-X.begin();
if (a == 0 && b == 0) F[i] = dp[0][0];
else Q[a][b].push_back(i);
}
for (int i=1; i<mp2.size(); ++i) {
LC.clear();
ll cur = -1e18;
for (int j=mp.size()-1; j>=0; --j) {
if (U[i-1][j]) LC.add(-U[i-1][j], U[i-1][j] * Y[i] + 2*dp[i][j]);
else cur = max(cur, 2*dp[i][j]);
for (auto z : Q[i][j]) {
F[z] = max(F[z], max(cur, LC.query(QY[z]))/2);
}
}
}
for (int i=1; i<mp.size(); ++i) {
LC.clear();
ll cur = -1e18;
for (int j=mp2.size()-1; j>=0; --j) {
if (R[j][i-1]) LC.add(-R[j][i-1], R[j][i-1] * X[i] + 2*dp[j][i]);
else cur = max(cur, 2*dp[j][i]);
for (auto z : Q[j][i]) {
F[z] = max(F[z], max(cur, LC.query(QX[z]))/2);
}
}
}
for (int i=0; i<q; ++i) cout << F[i] << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
bodyguard.cpp:11:1: error: 'vector' does not name a type 11 | vector <ll> X, Y; | ^~~~~~ bodyguard.cpp:12:1: error: 'vector' does not name a type 12 | vector <array<ll, 3>> VR[2800], VC[2800]; | ^~~~~~ bodyguard.cpp:13:1: error: 'vector' does not name a type 13 | vector <ll> Q[5600][5600]; | ^~~~~~ bodyguard.cpp: In function 'int main()': bodyguard.cpp:92:26: error: 'X' was not declared in this scope 92 | for (auto [x, y] : mp) X.push_back(x), mp[x] = X.size()-1; | ^ bodyguard.cpp:93:27: error: 'Y' was not declared in this scope 93 | for (auto [x, y] : mp2) Y.push_back(x), mp2[x] = Y.size()-1; | ^ bodyguard.cpp:96:7: error: 'VR' was not declared in this scope; did you mean 'R'? 96 | VR[mp2[A[i][0]-A[i][1]]].push_back({mp[A[i][0]+A[i][1]], mp[A[i][0]+abs(A[i][1]-A[i][2])+A[i][2]]-1, A[i][3]}); | ^~ | R bodyguard.cpp:99:7: error: 'VC' was not declared in this scope; did you mean 'LC'? 99 | VC[mp[A[i][0]+A[i][1]]].push_back({mp2[A[i][0]-A[i][1]], mp2[A[i][0]+abs(A[i][1]-A[i][2])-A[i][2]]-1, A[i][3]}); | ^~ | LC bodyguard.cpp:104:27: error: 'VR' was not declared in this scope; did you mean 'R'? 104 | for (auto [l, r, w] : VR[i]) { | ^~ | R bodyguard.cpp:111:27: error: 'VC' was not declared in this scope; did you mean 'LC'? 111 | for (auto [l, r, w] : VC[i]) { | ^~ | LC bodyguard.cpp:118:78: error: 'X' was not declared in this scope 118 | if (j != mp.size()-1) dp[i][j] = max(dp[i][j], dp[i][j+1] + R[i][j] * (X[j+1]-X[j])/2); | ^ bodyguard.cpp:119:79: error: 'Y' was not declared in this scope 119 | if (i != mp2.size()-1) dp[i][j] = max(dp[i][j], dp[i+1][j] + U[i][j] * (Y[i+1]-Y[i])/2); | ^ bodyguard.cpp:125:27: error: 'X' was not declared in this scope 125 | auto it = lower_bound(X.begin(), X.end(), QX[i]); | ^ bodyguard.cpp:126:28: error: 'Y' was not declared in this scope 126 | auto it2 = lower_bound(Y.begin(), Y.end(), QY[i]); | ^ bodyguard.cpp:130:10: error: 'Q' was not declared in this scope 130 | else Q[a][b].push_back(i); | ^ bodyguard.cpp:136:53: error: 'Y' was not declared in this scope 136 | if (U[i-1][j]) LC.add(-U[i-1][j], U[i-1][j] * Y[i] + 2*dp[i][j]); | ^ bodyguard.cpp:138:21: error: 'Q' was not declared in this scope 138 | for (auto z : Q[i][j]) { | ^ bodyguard.cpp:147:53: error: 'X' was not declared in this scope 147 | if (R[j][i-1]) LC.add(-R[j][i-1], R[j][i-1] * X[i] + 2*dp[j][i]); | ^ bodyguard.cpp:149:21: error: 'Q' was not declared in this scope 149 | for (auto z : Q[j][i]) { | ^ In file included from /usr/include/c++/11/map:60, from bodyguard.cpp:2: /usr/include/c++/11/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) const [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]': /usr/include/c++/11/bits/stl_tree.h:1326:42: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::iterator]' /usr/include/c++/11/bits/stl_multiset.h:822:42: required from 'decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) std::multiset<_Key, _Compare, _Alloc>::lower_bound(const _Kt&) [with _Kt = long long int; _Key = Line; _Compare = std::less<void>; _Alloc = std::allocator<Line>; decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]' bodyguard.cpp:41:26: required from here /usr/include/c++/11/bits/stl_tree.h:1337:40: error: no match for call to '(const std::less<void>) (const Line&, const long long int&)' 1337 | if (!_M_impl._M_key_compare(_S_key(__x), __k)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:596:9: note: candidate: 'template<class _Tp, class _Up> constexpr decltype ((forward<_Tp>(__t) < forward<_Up>(__u))) std::less<void>::operator()(_Tp&&, _Up&&) const' 596 | operator()(_Tp&& __t, _Up&& __u) const | ^~~~~~~~ /usr/include/c++/11/bits/stl_function.h:596:9: note: template argument deduction/substitution failed: /usr/include/c++/11/bits/stl_function.h: In substitution of 'template<class _Tp, class _Up> constexpr decltype ((forward<_Tp>(__t) < forward<_Up>(__u))) std::less<void>::operator()(_Tp&&, _Up&&) const [with _Tp = const Line&; _Up = const long long int&]': /usr/include/c++/11/bits/stl_tree.h:1337:33: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) const [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]' /usr/include/c++/11/bits/stl_tree.h:1326:42: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::iterator]' /usr/include/c++/11/bits/stl_multiset.h:822:42: required from 'decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) std::multiset<_Key, _Compare, _Alloc>::lower_bound(const _Kt&) [with _Kt = long long int; _Key = Line; _Compare = std::less<void>; _Alloc = std::allocator<Line>; decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]' bodyguard.cpp:41:26: required from here /usr/include/c++/11/bits/stl_function.h:598:44: error: no match for 'operator<' (operand types are 'const Line' and 'const long long int') 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:538:5: note: candidate: 'template<class _IteratorL, class _IteratorR> requires three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&)' (reversed) 538 | operator<=>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:538:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: mismatched types 'const std::reverse_iterator<_IteratorL>' and 'const long long int' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:1596:5: note: candidate: 'template<class _IteratorL, class _IteratorR> requires three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)' (reversed) 1596 | operator<=>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:1596:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'const long long int' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/basic_string.h:48, from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/string_view:556:5: note: candidate: 'template<class _CharT, class _Traits> constexpr decltype (__char_traits_cmp_cat<_Traits>(0)) std::operator<=>(std::basic_string_view<_CharT, _Traits>, std::__type_identity_t<std::basic_string_view<_CharT, _Traits> >)' (reversed) 556 | operator<=>(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/11/string_view:556:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/basic_string.h:6276:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> decltype (__char_traits_cmp_cat<_Traits>(0)) std::operator<=>(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' (reversed) 6276 | operator<=>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6276:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const long long int' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_map.h:63, from /usr/include/c++/11/map:61, from bodyguard.cpp:2: /usr/include/c++/11/tuple:1557:5: note: candidate: 'template<class ... _Tps, class ... _Ups> constexpr std::common_comparison_category_t<decltype (std::__detail::__synth3way(declval<_Tps&>(), declval<_Ups&>()))...> std::operator<=>(const std::tuple<_Tps ...>&, const std::tuple<_Args2 ...>&)' (reversed) 1557 | operator<=>(const tuple<_Tps...>& __t, const tuple<_Ups...>& __u) | ^~~~~~~~ /usr/include/c++/11/tuple:1557:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: mismatched types 'const std::tuple<_Tps ...>' and 'const long long int' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_pair.h:473:5: note: candidate: 'template<class _T1, class _T2> constexpr std::common_comparison_category_t<decltype (std::__detail::__synth3way(declval<_T1&>(), declval<_T1&>())), decltype (std::__detail::__synth3way(declval<_T2&>(), declval<_T2&>()))> std::operator<=>(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)' (rewritten) 473 | operator<=>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/11/bits/stl_pair.h:473:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::pair<_T1, _T2>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:554:5: note: candidate: 'template<class _Iterator> requires three_way_comparable<_Iterator, std::partial_ordering> constexpr std::compare_three_way_result_t<_Iterator, _Iterator> std::operator<=>(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorL>&)' (rewritten) 554 | operator<=>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:554:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::reverse_iterator<_IteratorL>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:1655:5: note: candidate: 'template<class _Iterator> requires three_way_comparable<_Iterator, std::partial_ordering> constexpr std::compare_three_way_result_t<_Iterator, _Iterator> std::operator<=>(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)' (rewritten) 1655 | operator<=>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:1655:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::move_iterator<_IteratorL>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/basic_string.h:48, from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/string_view:549:5: note: candidate: 'template<class _CharT, class _Traits> constexpr decltype (__char_traits_cmp_cat<_Traits>(0)) std::operator<=>(std::basic_string_view<_CharT, _Traits>, std::basic_string_view<_CharT, _Traits>)' (rewritten) 549 | operator<=>(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/11/string_view:549:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'Line' is not derived from 'std::basic_string_view<_CharT, _Traits>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/basic_string.h:6262:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> decltype (__char_traits_cmp_cat<_Traits>(0)) std::operator<=>(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' (rewritten) 6262 | operator<=>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6262:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/tuple:39, from /usr/include/c++/11/bits/stl_map.h:63, from /usr/include/c++/11/map:61, from bodyguard.cpp:2: /usr/include/c++/11/array:282:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::__detail::__synth3way_t<_T1> std::operator<=>(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)' (rewritten) 282 | operator<=>(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b) | ^~~~~~~~ /usr/include/c++/11/array:282:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::array<_Tp, _Nm>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/map:61, from bodyguard.cpp:2: /usr/include/c++/11/bits/stl_map.h:1484:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> std::__detail::__synth3way_t<std::pair<const _Key, _Tp> > std::operator<=>(const std::map<_Key, _Tp, _Compare, _Allocator>&, const std::map<_Key, _Tp, _Compare, _Allocator>&)' (rewritten) 1484 | operator<=>(const map<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_map.h:1484:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::map<_Key, _Tp, _Compare, _Allocator>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/map:62, from bodyguard.cpp:2: /usr/include/c++/11/bits/stl_multimap.h:1149:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> std::__detail::__synth3way_t<std::pair<const _Key, _Tp> > std::operator<=>(const std::multimap<_Key, _Tp, _Compare, _Allocator>&, const std::multimap<_Key, _Tp, _Compare, _Allocator>&)' (rewritten) 1149 | operator<=>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_multimap.h:1149:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Allocator>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from bodyguard.cpp:3: /usr/include/c++/11/bits/stl_set.h:1006:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> std::__detail::__synth3way_t<_T1> std::operator<=>(const std::set<_Key, _Compare, _Allocator>&, const std::set<_Key, _Compare, _Allocator>&)' (rewritten) 1006 | operator<=>(const set<_Key, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_set.h:1006:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::set<_Key, _Compare, _Allocator>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:62, from bodyguard.cpp:3: /usr/include/c++/11/bits/stl_multiset.h:992:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> std::__detail::__synth3way_t<_T1> std::operator<=>(const std::multiset<_Key, _Compare, _Allocator>&, const std::multiset<_Key, _Compare, _Allocator>&)' (rewritten) 992 | operator<=>(const multiset<_Key, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_multiset.h:992:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::multiset<_Key, _Compare, _Allocator>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/ios_base.h:46, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/system_error:261:3: note: candidate: 'std::strong_ordering std::operator<=>(const std::error_code&, const std::error_code&)' (rewritten) 261 | operator<=>(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/11/system_error:261:33: note: no known conversion for argument 1 from 'const Line' to 'const std::error_code&' 261 | operator<=>(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/system_error:387:3: note: candidate: 'std::strong_ordering std::operator<=>(const std::error_condition&, const std::error_condition&)' (rewritten) 387 | operator<=>(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/11/system_error:387:38: note: no known conversion for argument 1 from 'const Line' to 'const std::error_condition&' 387 | operator<=>(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ bodyguard.cpp:19:8: note: candidate: 'bool Line::operator<(const Line&) const' 19 | bool operator<(const Line &o) const {return m < o.m;} | ^~~~~~~~ bodyguard.cpp:19:30: note: no known conversion for argument 1 from 'const long long int' to 'const Line&' 19 | bool operator<(const Line &o) const {return m < o.m;} | ~~~~~~~~~~~~^ bodyguard.cpp:20:8: note: candidate: 'bool Line::operator<(long double)' (near match) 20 | bool operator<(ld x) {return d < x; } | ^~~~~~~~ bodyguard.cpp:20:8: note: passing 'const Line*' as 'this' argument discards qualifiers In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:509:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&) requires requires{{std::operator<::__x->base() > std::operator<::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' 509 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:509:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::reverse_iterator<_IteratorL>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:1609:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&) requires requires{{std::operator<::__x->base() < std::operator<::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' 1609 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:1609:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/string:48, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from bodyguard.cpp:1: /usr/include/c++/11/bits/stl_function.h:598:44: note: 'const Line' is not derived from 'const std::move_iterator<_IteratorL>' 598 | -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) const [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]': /usr/include/c++/11/bits/stl_tree.h:1326:42: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound_tr(const _Kt&) [with _Kt = long long int; _Req = void; _Key = Line; _Val = Line; _KeyOfValue = std::_Identity<Line>; _Compare = std::less<void>; _Alloc = std::allocator<Line>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::iterator]' /usr/include/c++/11/bits/stl_multiset.h:822:42: required from 'decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) std::multiset<_Key, _Compare, _Alloc>::lower_bound(const _Kt&) [with _Kt = long long int; _Key = Line; _Compare = std::less<void>; _Alloc = std::allocator<Line>; decltype ((std::multiset<_Key, _Compare, _Alloc>::iterator)(((std::multiset<_Key, _Compare, _Alloc>*)this)->std::multiset<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Line, Line, std::_Identity<Line>, std::less<void>, std::allocator<Line> >::const_iterator]' bodyguard.cpp:41:26: required from here /usr/include/c++/11/bits/stl_function.h:606:9: note: candidate: 'template<class _Tp, class _Up> constexpr bool std::less<void>::operator()(_Tp*, _Up*) const' 606 | operator()(_Tp* __t, _Up* __u) const noexcept | ^~~~~~~~ /usr/include/c++/11/bits/stl_function.h:606:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/map:60, from bodyguard.cpp:2: /usr/include/c++/11/bits/stl_tree.h:1337:40: note: mismatched types '_Tp*' and 'Line' 1337 | if (!_M_impl._M_key_compare(_S_key(__x), __k)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~