sorting.cpp: In function 'int rnd(int)':
sorting.cpp:18:33: warning: conversion from 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
18 | int rnd(int x) { return mrand() % x;}
| ~~~~~~~~^~~
sorting.cpp: In function 'void gao(int, int*, int*)':
sorting.cpp:47:6: warning: unused variable 'cnt' [-Wunused-variable]
47 | int cnt=0;
| ^~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:68:50: warning: declaration of 'y' shadows a global declaration [-Wshadow]
68 | int findSwapPairs(int n,int* s,int m,int* x,int* y,int* p,int* q) {
| ~~~~~^
sorting.cpp:24:35: note: shadowed declaration is here
24 | int n,a[N],s[N],id[N],pos[N],x[N],y[N];
| ^
sorting.cpp:68:43: warning: declaration of 'x' shadows a global declaration [-Wshadow]
68 | int findSwapPairs(int n,int* s,int m,int* x,int* y,int* p,int* q) {
| ~~~~~^
sorting.cpp:24:30: note: shadowed declaration is here
24 | int n,a[N],s[N],id[N],pos[N],x[N],y[N];
| ^
sorting.cpp:68:30: warning: declaration of 's' shadows a global declaration [-Wshadow]
68 | int findSwapPairs(int n,int* s,int m,int* x,int* y,int* p,int* q) {
| ~~~~~^
sorting.cpp:24:12: note: shadowed declaration is here
24 | int n,a[N],s[N],id[N],pos[N],x[N],y[N];
| ^
sorting.cpp:68:23: warning: declaration of 'n' shadows a global declaration [-Wshadow]
68 | int findSwapPairs(int n,int* s,int m,int* x,int* y,int* p,int* q) {
| ~~~~^
sorting.cpp:24:5: note: shadowed declaration is here
24 | int n,a[N],s[N],id[N],pos[N],x[N],y[N];
| ^
sorting.cpp:75:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
75 | int md=l+r>>1;
| ~^~