bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:56:26: error: 'n' was not declared in this scope
56 | for (int i = 1; i <= n; i++) arr.pb({a[i], i});
| ^
bubblesort2.cpp:57:26: error: 'q' was not declared in this scope
57 | for (int i = 1; i <= q; i++) arr.pb({x[i], v[i]});
| ^
bubblesort2.cpp:60:25: error: 'n' was not declared in this scope
60 | for (int i = 0; i < n; i++) {
| ^
bubblesort2.cpp:61:30: error: no matching function for call to 'lower_bound(std::vector<std::pair<int, int> >::iterator, std::vector<std::pair<int, int> >::iterator, <brace-enclosed initializer list>)'
61 | int pos = lower_bound(all(arr), {a[i], i}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
from bubblesort2.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
1498 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:61:30: note: couldn't deduce template parameter '_Tp'
61 | int pos = lower_bound(all(arr), {a[i], i}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> constexpr _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)'
2005 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:61:30: note: candidate expects 4 arguments, 3 provided
61 | int pos = lower_bound(all(arr), {a[i], i}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
bubblesort2.cpp:66:21: error: 'q' was not declared in this scope
66 | vector<int> ans(q);
| ^
bubblesort2.cpp:68:30: error: no matching function for call to 'lower_bound(std::vector<std::pair<int, int> >::iterator, std::vector<std::pair<int, int> >::iterator, <brace-enclosed initializer list>)'
68 | int pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
1498 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:68:30: note: couldn't deduce template parameter '_Tp'
68 | int pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> constexpr _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)'
2005 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:68:30: note: candidate expects 4 arguments, 3 provided
68 | int pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
bubblesort2.cpp:72:26: error: no matching function for call to 'lower_bound(std::vector<std::pair<int, int> >::iterator, std::vector<std::pair<int, int> >::iterator, <brace-enclosed initializer list>)'
72 | pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
1498 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:72:26: note: couldn't deduce template parameter '_Tp'
72 | pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> constexpr _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)'
2005 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:2005:5: note: template argument deduction/substitution failed:
bubblesort2.cpp:72:26: note: candidate expects 4 arguments, 3 provided
72 | pos = lower_bound(all(arr), {a[x[i]], x[i]}) - arr.begin() + 1;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~