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:67:50: warning: declaration of 'y' shadows a global declaration [-Wshadow]
67 | 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:67:43: warning: declaration of 'x' shadows a global declaration [-Wshadow]
67 | 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:67:30: warning: declaration of 's' shadows a global declaration [-Wshadow]
67 | 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:67:23: warning: declaration of 'n' shadows a global declaration [-Wshadow]
67 | 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:74:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
74 | int md=l+r>>1;
| ~^~