sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:58:7: error: redeclaration of 'vii swap'
vii swap;
^~~~
sorting.cpp:46:7: note: 'vii swap' previously declared here
vii swap;
^~~~
sorting.cpp:63:25: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(ll&, ll&)'
swap.push_back(s,cur);
^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/queue:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
from sorting.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]
push_back(const value_type& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:953:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]
push_back(value_type&& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note: candidate expects 1 argument, 2 provided
sorting.cpp:82:29: warning: conversion to 'int' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' may alter its value [-Wconversion]
P[i] = inv[swap[i].first];
^
sorting.cpp:83:30: warning: conversion to 'int' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' may alter its value [-Wconversion]
Q[i] = inv[swap[i].second];
^
sorting.cpp:89:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
return hi;
^~
sorting.cpp:16:39: warning: unused parameter 'M' [-Wunused-parameter]
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
^