sorting.cpp: In function 'bool check(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:33:12: warning: declaration of 'j' shadows a previous local [-Wshadow]
33 | for(int j=0; j+1<v.size(); j++)
| ^
sorting.cpp:25:8: note: shadowed declaration is here
25 | int j=cur[i]; used[i]=1;
| ^
sorting.cpp:33:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for(int j=0; j+1<v.size(); j++)
| ~~~^~~~~~~~~
sorting.cpp:37:15: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
37 | if(ans.size()>m) return 0;
| ~~~~~~~~~~^~
sorting.cpp:44:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
44 | if(i<ans.size())
| ~^~~~~~~~~~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:56:39: warning: unused parameter 'M' [-Wunused-parameter]
56 | int findSwapPairs(int n, int S[], int M, int X[], int Y[], int P[], int Q[])
| ~~~~^