sorting.cpp: In function 'std::vector<std::pair<int, int> > count_cost(int*)':
sorting.cpp:24:39: warning: declaration of 's' shadows a global declaration [-Wshadow]
24 | vector<pair<int,int>> count_cost(int *s) {
| ~~~~~^
sorting.cpp:21:19: note: shadowed declaration is here
21 | int n, a[MAX_N], *s, *p, *q;
| ^
sorting.cpp:25:14: warning: declaration of 'a' shadows a global declaration [-Wshadow]
25 | vector<int> a(s, s+n);
| ^
sorting.cpp:21:8: note: shadowed declaration is here
21 | int n, a[MAX_N], *s, *p, *q;
| ^
sorting.cpp: In function 'bool valid(int)':
sorting.cpp:54:17: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
54 | if (swv.size() > len) return false;
| ~~~~~~~~~~~^~~~~
sorting.cpp:56:20: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
56 | while (swv.size() < len) swv.pb(0, 0);
| ~~~~~~~~~~~^~~~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:14:17: warning: statement has no effect [-Wunused-value]
14 | #define DE(...) 0
| ^
sorting.cpp:74:3: note: in expansion of macro 'DE'
74 | DE(sx[i], sy[i]);
| ^~
sorting.cpp:78:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
78 | mid = l + r >> 1;
| ~~^~~
sorting.cpp:14:17: warning: statement has no effect [-Wunused-value]
14 | #define DE(...) 0
| ^
sorting.cpp:86:2: note: in expansion of macro 'DE'
86 | DE(l);
| ^~
sorting.cpp:70:39: warning: unused parameter 'M' [-Wunused-parameter]
70 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^