sorting.cpp: In function 'bool check(int)':
sorting.cpp:56:7: warning: declaration of 'x' shadows a global declaration [-Wshadow]
int x= pos[b[i]], y=pos[i];
^
sorting.cpp:34:29: note: shadowed declaration is here
int n, q, a[N], b[N], s[N], x[3 * N], y[3 * N];
^
sorting.cpp:56:21: warning: declaration of 'y' shadows a global declaration [-Wshadow]
int x= pos[b[i]], y=pos[i];
^
sorting.cpp:34:39: note: shadowed declaration is here
int n, q, a[N], b[N], s[N], x[3 * N], y[3 * N];
^
sorting.cpp:60:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (ans.size() < k)
~~~~~~~~~~~^~~
sorting.cpp:62:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return(ans.size() <= k);
~~~~~~~~~~~^~~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:66:76: warning: declaration of 'N' shadows a global declaration [-Wshadow]
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
^
sorting.cpp:32:11: note: shadowed declaration is here
const int N = 200005;
^
sorting.cpp:91:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < ans.size(); i++)
~~^~~~~~~~~~~~
sorting.cpp:96:17: warning: conversion to 'int' from 'std::vector<std::pair<int, int> >::size_type {aka long unsigned int}' may alter its value [-Wconversion]
return ans.size();
~~~~~~~~^~
sorting.cpp:90:7: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
check(c);
~~~~~^~~