bubblesort2.cpp: In function 'void bubble(std::vector<int>&)':
bubblesort2.cpp:88:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
88 | for(int i = 0;i+1<v.size();i++){
| ~~~^~~~~~~~~
bubblesort2.cpp: In function 'bool sorted(std::vector<int>&)':
bubblesort2.cpp:94:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
94 | for(int i = 0;i+1<v.size();i++){
| ~~~^~~~~~~~~
bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:109:73: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_pbds::detail::bin_search_tree_set<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::detail::tree_traits<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::tree_order_statistics_node_update, __gnu_pbds::rb_tree_tag, std::allocator<char> >, std::allocator<char> >::size_type)'
109 | ans.back() = max(ans.back(),st.size()-st.order_of_key(pii(A[j],j)));
| ^
In file included from /usr/include/c++/10/vector:60,
from bubblesort2.h:1,
from bubblesort2.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:109:73: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_pbds::detail::bin_search_tree_set<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::detail::tree_traits<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::tree_order_statistics_node_update, __gnu_pbds::rb_tree_tag, std::allocator<char> >, std::allocator<char> >::size_type' {aka 'long unsigned int'})
109 | ans.back() = max(ans.back(),st.size()-st.order_of_key(pii(A[j],j)));
| ^
In file included from /usr/include/c++/10/vector:60,
from bubblesort2.h:1,
from bubblesort2.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:109:73: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_pbds::detail::bin_search_tree_set<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::detail::tree_traits<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::tree_order_statistics_node_update, __gnu_pbds::rb_tree_tag, std::allocator<char> >, std::allocator<char> >::size_type' {aka 'long unsigned int'})
109 | ans.back() = max(ans.back(),st.size()-st.order_of_key(pii(A[j],j)));
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from bubblesort2.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:109:73: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
109 | ans.back() = max(ans.back(),st.size()-st.order_of_key(pii(A[j],j)));
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from bubblesort2.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:109:73: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
109 | ans.back() = max(ans.back(),st.size()-st.order_of_key(pii(A[j],j)));
| ^
bubblesort2.cpp:105:7: warning: unused variable 'p' [-Wunused-variable]
105 | int p = X[i],v = V[i];
| ^
bubblesort2.cpp:105:16: warning: unused variable 'v' [-Wunused-variable]
105 | int p = X[i],v = V[i];
| ^