sorting.cpp: In function 'bool check(int)':
sorting.cpp:17:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
17 | for(int j=0;j<x&&j<swaps.size();j++)
| ~^~~~~~~~~~~~~
sorting.cpp:36:8: warning: unused variable 'u' [-Wunused-variable]
36 | int u=i;
| ^
sorting.cpp:53:17: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
53 | if(moves.size()<=x)
| ~~~~~~~~~~~~^~~
sorting.cpp:55:21: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
55 | while(moves.size()<x)moves.push_back({0,0});
| ~~~~~~~~~~~~^~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:85:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
85 | for(int i=0;i<moves.size();i++)
| ~^~~~~~~~~~~~~
sorting.cpp:110:19: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
110 | return moves.size();
| ~~~~~~~~~~^~
sorting.cpp:76:7: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
76 | check(ans);
| ~~~~~^~~~~