sorting.cpp: In function 'bool check(std::vector<int>, int, int)':
sorting.cpp:21:24: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
21 | while(swaps.size() < x) {
| ~~~~~~~~~~~~~^~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:27:28: warning: declaration of 'ans' shadows a global declaration [-Wshadow]
27 | vector<pair<int, int>> ans;
| ^~~
sorting.cpp:4:24: note: shadowed declaration is here
4 | vector<pair<int, int>> ans, xy, swaps;
| ^~~
sorting.cpp:37:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
37 | for (int i = 0; i < ans.size(); i++) {
| ~~^~~~~~~~~~~~
sorting.cpp:41:20: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
41 | return ans.size();
| ~~~~~~~~^~