sorting.cpp: In function 'std::vector<std::pair<int, int> > getSwaps(int)':
sorting.cpp:33:12: warning: declaration of 'i' shadows a previous local [-Wshadow]
33 | for (int i = 1; i < check.size(); i++) {ret.push_back({check[i - 1], check[i]});}
| ^
sorting.cpp:30:11: note: shadowed declaration is here
30 | for (int i = 0; i < N; i++)
| ^
sorting.cpp:33:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for (int i = 1; i < check.size(); i++) {ret.push_back({check[i - 1], check[i]});}
| ~~^~~~~~~~~~~~~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:39:76: warning: declaration of 'S' shadows a global declaration [-Wshadow]
39 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
| ^
sorting.cpp:11:5: note: shadowed declaration is here
11 | pii S[600001];
| ^
sorting.cpp:39:76: warning: declaration of 'N' shadows a global declaration [-Wshadow]
39 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
| ^
sorting.cpp:10:5: note: shadowed declaration is here
10 | int N, A[200001], T[200001], pos[200001];
| ^
sorting.cpp:48:7: warning: declaration of 'int M' shadows a parameter [-Wshadow]
48 | int M = L + R >> 1;
| ^
sorting.cpp:39:39: note: shadowed declaration is here
39 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
| ~~~~^
sorting.cpp:48:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
48 | int M = L + R >> 1;
| ~~^~~
sorting.cpp:49:26: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
49 | if (getSwaps(M).size() <= M) {R = M;}
| ~~~~~~~~~~~~~~~~~~~^~~~
sorting.cpp:60:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
60 | if (i < V.size())
| ~~^~~~~~~~~~