sorting.cpp: In function 'bool check(std::vector<int>, int, int)':
sorting.cpp:28:22: warning: comparison of integer expressions of different signedness: 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
28 | if (swaps.size() > m)return 0;
| ~~~~~~~~~~~~~^~~
sorting.cpp:30:24: warning: comparison of integer expressions of different signedness: 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
30 | while(swaps.size() < m) swaps.push_back({0, 0});
| ~~~~~~~~~~~~~^~~
sorting.cpp:35:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
35 | auto [x, y] = swaps[i];
| ^
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:49:13: warning: declaration of 'int m' shadows a parameter [-Wshadow]
49 | int m = (l + r)/2;
| ^
sorting.cpp:42:39: note: shadowed declaration is here
42 | int findSwapPairs(int n, int A[], int m, int X[], int Y[], int P[], int Q[]) {
| ~~~~^
sorting.cpp:57:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
57 | for (int i = 0; i < ans.size(); i++) {
| ~~^~~~~~~~~~~~
sorting.cpp:61:20: warning: conversion from 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
61 | return ans.size();
| ~~~~~~~~^~