sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:47:26: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
47 | ans += mag[i].size() - 1;
| ^
sorting.cpp:59:7: warning: declaration of 'cnt' shadows a previous local [-Wshadow]
59 | int cnt = 0;
| ^~~
sorting.cpp:38:6: note: shadowed declaration is here
38 | int cnt = 0;
| ^~~
sorting.cpp:68:27: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
68 | ans += mag[i].size() - 1;
| ^
sorting.cpp:12:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
12 | #define rep(i,a,b) for(int i=a;i<b;i++)
......
72 | rep(j, 0, mag[i].size() - 1) {
| ~~~~~~~~~~~~~~~~~~~~~~~
sorting.cpp:72:5: note: in expansion of macro 'rep'
72 | rep(j, 0, mag[i].size() - 1) {
| ^~~
sorting.cpp:29:73: warning: unused parameter 'Q' [-Wunused-parameter]
29 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]) {
| ~~~~^~~
sorting.cpp:81:1: warning: control reaches end of non-void function [-Wreturn-type]
81 | }
| ^