sorting.cpp:9:22: error: 'int index [200004]' redeclared as different kind of entity
9 | int mov[NS], index[NS], pos[NS], S_save[NS];
| ^
In file included from /usr/include/c++/9/cstring:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:48,
from sorting.cpp:2:
/usr/include/string.h:477:1: note: previous declaration 'const char* index(const char*, int)'
477 | index (const char *__s, int __c) __THROW
| ^~~~~
sorting.cpp: In lambda function:
sorting.cpp:19:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | mov[i] = i; index[i] = i;
| ^
sorting.cpp:28:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
28 | swap(index[X[i]], index[Y[i]]);
| ^
sorting.cpp:28:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
28 | swap(index[X[i]], index[Y[i]]);
| ^
sorting.cpp:33:34: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
33 | P[i] = index[diff], Q[i] = index[pos[mov[diff]]];
| ^
sorting.cpp:33:64: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
33 | P[i] = index[diff], Q[i] = index[pos[mov[diff]]];
| ^
sorting.cpp:34:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
34 | swap(index[diff], index[pos[mov[diff]]]);
| ^
sorting.cpp:34:55: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
34 | swap(index[diff], index[pos[mov[diff]]]);
| ^
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:11:39: warning: unused parameter 'M' [-Wunused-parameter]
11 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
| ~~~~^