building.cpp:51:43: error: wrong number of template arguments (0, should be 1)
51 | struct CHT_black_box : multiset<line, less<>>
| ^
In file included from /usr/include/c++/9/string:48,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/stl_function.h:381:12: note: provided for 'template<class _Tp> struct std::less'
381 | struct less : public binary_function<_Tp, _Tp, bool>
| ^~~~
building.cpp:51:44: error: template argument 2 is invalid
51 | struct CHT_black_box : multiset<line, less<>>
| ^~
building.cpp:56:13: error: 'iterator' is not a type
56 | bool isect(iterator x, iterator y)
| ^~~~~~~~
building.cpp:56:25: error: 'iterator' is not a type
56 | bool isect(iterator x, iterator y)
| ^~~~~~~~
building.cpp: In member function 'bool CHT_black_box::isect(int, int)':
building.cpp:58:15: error: no matching function for call to 'end()'
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
/usr/include/c++/9/initializer_list:99:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:68:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:78:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:97:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from building.cpp:1:
/usr/include/c++/9/valarray:1234:5: note: candidate: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from building.cpp:1:
/usr/include/c++/9/valarray:1244:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1244:5: note: template argument deduction/substitution failed:
building.cpp:58:15: note: candidate expects 1 argument, 0 provided
58 | if(y == end()){x->p = INF; return false;}
| ^
building.cpp:58:19: error: base operand of '->' is not a pointer
58 | if(y == end()){x->p = INF; return false;}
| ^~
building.cpp:59:7: error: base operand of '->' is not a pointer
59 | if(x->m == y->m) x->p = (x->c > y->c) ? INF : -INF;
| ^~
building.cpp:59:15: error: base operand of '->' is not a pointer
59 | if(x->m == y->m) x->p = (x->c > y->c) ? INF : -INF;
| ^~
building.cpp:59:21: error: base operand of '->' is not a pointer
59 | if(x->m == y->m) x->p = (x->c > y->c) ? INF : -INF;
| ^~
building.cpp:59:29: error: base operand of '->' is not a pointer
59 | if(x->m == y->m) x->p = (x->c > y->c) ? INF : -INF;
| ^~
building.cpp:59:36: error: base operand of '->' is not a pointer
59 | if(x->m == y->m) x->p = (x->c > y->c) ? INF : -INF;
| ^~
building.cpp:60:9: error: base operand of '->' is not a pointer
60 | else x->p = div((y->c - x->c),(x->m - y->m));
| ^~
building.cpp:60:21: error: base operand of '->' is not a pointer
60 | else x->p = div((y->c - x->c),(x->m - y->m));
| ^~
building.cpp:60:28: error: base operand of '->' is not a pointer
60 | else x->p = div((y->c - x->c),(x->m - y->m));
| ^~
building.cpp:60:35: error: base operand of '->' is not a pointer
60 | else x->p = div((y->c - x->c),(x->m - y->m));
| ^~
building.cpp:60:42: error: base operand of '->' is not a pointer
60 | else x->p = div((y->c - x->c),(x->m - y->m));
| ^~
building.cpp:61:12: error: base operand of '->' is not a pointer
61 | return (x->p >= y->p);
| ^~
building.cpp:61:20: error: base operand of '->' is not a pointer
61 | return (x->p >= y->p);
| ^~
building.cpp: In member function 'void CHT_black_box::add(long long int, long long int)':
building.cpp:65:12: error: 'insert' was not declared in this scope; did you mean 'isect'?
65 | auto z = insert({mode * slope, mode * intercept, 0}), y = z++, x = y;
| ^~~~~~
| isect
building.cpp:66:15: error: 'y' was not declared in this scope
66 | while(isect(y, z)) z = erase(z);
| ^
building.cpp:66:26: error: 'erase' was not declared in this scope
66 | while(isect(y, z)) z = erase(z);
| ^~~~~
building.cpp:67:6: error: 'x' was not declared in this scope
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
building.cpp:67:17: error: no matching function for call to 'begin()'
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/initializer_list:89:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
89 | begin(initializer_list<_Tp> __ils) noexcept
| ^~~~~
/usr/include/c++/9/initializer_list:89:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:48:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
48 | begin(_Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:58:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
58 | begin(const _Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:87:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
87 | begin(_Tp (&__arr)[_Nm])
| ^~~~~
/usr/include/c++/9/bits/range_access.h:87:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from building.cpp:1:
/usr/include/c++/9/valarray:1214:5: note: candidate: 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
1214 | begin(valarray<_Tp>& __va)
| ^~~~~
/usr/include/c++/9/valarray:1214:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from building.cpp:1:
/usr/include/c++/9/valarray:1224:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
1224 | begin(const valarray<_Tp>& __va)
| ^~~~~
/usr/include/c++/9/valarray:1224:5: note: template argument deduction/substitution failed:
building.cpp:67:17: note: candidate expects 1 argument, 0 provided
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
building.cpp:67:33: error: 'y' was not declared in this scope
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^
building.cpp:67:50: error: 'erase' was not declared in this scope
67 | if(x != begin() && isect(--x, y)) isect(x, y = erase(y));
| ^~~~~
building.cpp:68:10: error: 'y' was not declared in this scope
68 | while((y=x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
| ^
building.cpp:68:12: error: 'x' was not declared in this scope
68 | while((y=x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
| ^
building.cpp:68:24: error: no matching function for call to 'begin()'
68 | while((y=x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
| ^
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/initializer_list:89:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
89 | begin(initializer_list<_Tp> __ils) noexcept
| ^~~~~
/usr/include/c++/9/initializer_list:89:5: note: template argument deduction/substitution failed:
building.cpp:68:24: note: candidate expects 1 argument, 0 provided
68 | while((y=x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from building.cpp:1:
/usr/include/c++/9/bits/range_access.h:48:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
48 | begin(_Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note: template argument deduction/substitution failed:
building.cpp:68:24: note: candidate expects 1 argument, 0 provided
68 | while((y=x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
| ^
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,