sorting.cpp: In function 'int check(int)':
sorting.cpp:14:32: error: 'X' was not declared in this scope
14 | for(int i=0;i<stop;i++)swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:14:40: error: 'Y' was not declared in this scope
14 | for(int i=0;i<stop;i++)swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:18:8: error: 'S' was not declared in this scope
18 | s[i]=S[i]; pos[s[i]]=i;
| ^
sorting.cpp:24:3: error: 'P' was not declared in this scope
24 | P[i]=Q[i]=0;
| ^
sorting.cpp:24:8: error: 'Q' was not declared in this scope
24 | P[i]=Q[i]=0;
| ^
sorting.cpp:26:10: error: 'X' was not declared in this scope
26 | swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:26:18: error: 'Y' was not declared in this scope
26 | swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:43:8: error: 'S' was not declared in this scope
43 | s[i]=S[i];
| ^
sorting.cpp:50:8: error: 'X' was not declared in this scope
50 | if(s[X[i]]==X[i])br--;
| ^
sorting.cpp:51:8: error: 'Y' was not declared in this scope
51 | if(s[Y[i]]==Y[i])br--;
| ^
sorting.cpp:53:10: error: 'X' was not declared in this scope
53 | swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:53:18: error: 'Y' was not declared in this scope
53 | swap(s[X[i]],s[Y[i]]);
| ^
sorting.cpp:58:8: error: 'P' was not declared in this scope
58 | if(s[P[i]]==P[i])br--;
| ^
sorting.cpp:59:8: error: 'Q' was not declared in this scope
59 | if(s[Q[i]]==Q[i])br--;
| ^
sorting.cpp:61:10: error: 'P' was not declared in this scope
61 | swap(s[P[i]],s[Q[i]]);
| ^
sorting.cpp:61:18: error: 'Q' was not declared in this scope
61 | swap(s[P[i]],s[Q[i]]);
| ^
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:78:7: warning: declaration of 'tt' shadows a previous local [-Wshadow]
78 | int tt=(l+r)/2;
| ^~
sorting.cpp:76:15: note: shadowed declaration is here
76 | int l=-1,r=n,tt;
| ^~
sorting.cpp:76:15: warning: unused variable 'tt' [-Wunused-variable]
sorting.cpp:73:30: warning: unused parameter 'S' [-Wunused-parameter]
73 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~
sorting.cpp:73:46: warning: unused parameter 'X' [-Wunused-parameter]
73 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~
sorting.cpp:73:55: warning: unused parameter 'Y' [-Wunused-parameter]
73 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~
sorting.cpp:73:64: warning: unused parameter 'P' [-Wunused-parameter]
73 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~
sorting.cpp:73:73: warning: unused parameter 'Q' [-Wunused-parameter]
73 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~