sorting.cpp: In function 'bool check(int)':
sorting.cpp:62: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[30 * N], y[30 * N];
^
sorting.cpp:62:21: warning: declaration of 'y' shadows a global declaration [-Wshadow]
int x= pos[b[i]], y=pos[i];
^
sorting.cpp:34:40: note: shadowed declaration is here
int n, q, a[N], b[N], s[N], x[30 * N], y[30 * N];
^
sorting.cpp:67:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (ans.size() < k)
~~~~~~~~~~~^~~
sorting.cpp:69: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:73: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:102:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < ans.size(); i++)
~~^~~~~~~~~~~~
sorting.cpp:107: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:85:6: warning: unused variable 'l' [-Wunused-variable]
int l=0, r=n-1, m, c;
^
sorting.cpp:85:11: warning: unused variable 'r' [-Wunused-variable]
int l=0, r=n-1, m, c;
^
sorting.cpp:85:18: warning: unused variable 'm' [-Wunused-variable]
int l=0, r=n-1, m, c;
^