sorting.cpp: In function 'bool check(int)':
sorting.cpp:16: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]
16 | for(int j=0;j<x&&j<swaps.size();j++)
| ~^~~~~~~~~~~~~
sorting.cpp:49: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]
49 | if(moves.size()<=x)
| ~~~~~~~~~~~~^~~
sorting.cpp:51: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]
51 | while(moves.size()<x)moves.push_back({0,0});
| ~~~~~~~~~~~~^~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:73: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]
73 | for(int i=0;i<moves.size();i++)
| ~^~~~~~~~~~~~~
sorting.cpp:77:19: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
77 | return moves.size();
| ~~~~~~~~~~^~
sorting.cpp:72:7: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
72 | check(ans);
| ~~~~~^~~~~