sorting.cpp: In function 'int howmanydoineed(std::vector<int>)':
sorting.cpp:6:17: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
6 | int n=v.size(),ans=n;
| ~~~~~~^~
sorting.cpp: In function 'void getswaps(std::vector<int>)':
sorting.cpp:21:14: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
21 | int n=v.size();
| ~~~~~~^~
sorting.cpp: In function 'void docheck2(int, int, int*, int*, int*)':
sorting.cpp:50: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]
50 | if(SWP.size()<k)
| ~~~~~~~~~~^~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:58:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
58 | int mid=l+r>>1;
| ~^~
sorting.cpp:71:20: warning: declaration of 'int M' shadows a parameter [-Wshadow]
71 | int K=vals[ermx],M=vals[ermy];
| ^
sorting.cpp:55:39: note: shadowed declaration is here
55 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^
sorting.cpp:74:7: warning: declaration of 'l' shadows a previous local [-Wshadow]
74 | int l=pos[x],r=pos[y];
| ^
sorting.cpp:56:6: note: shadowed declaration is here
56 | int l=0,r=M,res=1e9;
| ^
sorting.cpp:74:16: warning: declaration of 'r' shadows a previous local [-Wshadow]
74 | int l=pos[x],r=pos[y];
| ^
sorting.cpp:56:10: note: shadowed declaration is here
56 | int l=0,r=M,res=1e9;
| ^