sorting.cpp:6:32: error: expected ',' or '...' before 'S'
6 | int findSwapPairs(int N, int[] S, int M, int[] X, int[] Y, int[] P, int[] Q){
| ^
sorting.cpp: In function 'int findSwapPairs(int, int*)':
sorting.cpp:7:16: error: 'M' was not declared in this scope
7 | int l=0, r=M-1;
| ^
sorting.cpp:11:12: error: 'S' was not declared in this scope
11 | if(S[i]!=i){
| ^
sorting.cpp:22:26: error: 'S' was not declared in this scope
22 | vector <int> aux=S;
| ^
sorting.cpp:25:27: error: 'X' was not declared in this scope
25 | int aguss=aux[X[i]];
| ^
sorting.cpp:26:27: error: 'Y' was not declared in this scope
26 | aux[X[i]]=aux[Y[i]];
| ^
sorting.cpp:60:21: error: 'X' was not declared in this scope
60 | int aguss=t[X[l-1-i]];
| ^
sorting.cpp:61:23: error: 'Y' was not declared in this scope
61 | t[X[l-1-i]]=t[Y[l-1-i]];
| ^
sorting.cpp:67:9: error: 'P' was not declared in this scope
67 | P[i]=bs[l-1-i].first;
| ^
sorting.cpp:68:9: error: 'Q' was not declared in this scope
68 | Q[i]=bs[l-1-i].second;
| ^