road_construction.cpp: In function 'int main()':
road_construction.cpp:94:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
94 | ((chk(l + r >> 1)) < k ? l : r) = l + r >> 1;
| ~~^~~
road_construction.cpp:94:45: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
94 | ((chk(l + r >> 1)) < k ? l : r) = l + r >> 1;
| ~~^~~
road_construction.cpp:99:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
99 | ((chk(l + r >> 1)) >= k ? r : l) = l + r >> 1;
| ~~^~~
road_construction.cpp:99:46: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
99 | ((chk(l + r >> 1)) >= k ? r : l) = l + r >> 1;
| ~~^~~
road_construction.cpp:112:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
112 | if (i < ans.size()) cout << ans[i] << '\n';
| ~~^~~~~~~~~~~~
In file included from /usr/include/c++/9/map:60,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from road_construction.cpp:1:
/usr/include/c++/9/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = Pt; _Val = Pt; _KeyOfValue = std::_Identity<Pt>; _Compare = cmp; _Alloc = std::allocator<Pt>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<Pt>*]':
/usr/include/c++/9/bits/stl_tree.h:1997:37: required from 'std::pair<std::_Rb_tree_iterator<_Val>, std::_Rb_tree_iterator<_Val> > std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::equal_range(const _Key&) [with _Key = Pt; _Val = Pt; _KeyOfValue = std::_Identity<Pt>; _Compare = cmp; _Alloc = std::allocator<Pt>]'
/usr/include/c++/9/bits/stl_tree.h:2534:32: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(const _Key&) [with _Key = Pt; _Val = Pt; _KeyOfValue = std::_Identity<Pt>; _Compare = cmp; _Alloc = std::allocator<Pt>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type = long unsigned int]'
/usr/include/c++/9/bits/stl_set.h:685:30: required from 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::erase(const key_type&) [with _Key = Pt; _Compare = cmp; _Alloc = std::allocator<Pt>; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = Pt]'
road_construction.cpp:104:60: required from here
/usr/include/c++/9/bits/stl_tree.h:780:8: error: static assertion failed: comparison object must be invocable as const
780 | is_invocable_v<const _Compare&, const _Key&, const _Key&>,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~