Below is my code and it is giving errors for some test cases. Please help me out.
#include<bits/stdc++.h>
using namespace std;
const bool sortBySecondDesc(const pair<long long int,long long int> &a,const pair<long long int,long long int> &b){
return(a.second > b.second);
}
int main(){
long long int N,inp;
cin>>N;
vector< pair<long long int,long long int> > p;
vector v1;
vector v2;
for(long long int i=0;i<N;i++){
cin>>inp;
v1.push_back(inp);
}
for(long long int i=0;i<N;i++){
cin>>inp;
v2.push_back(inp);
}
for(long long int j=0;j<N;j++){
p.push_back(make_pair(v1[j],v2[j]));
}
sort(p.begin(),p.end(),sortBySecondDesc);
for(auto i:p){
cout<<i.first<<" “<<i.second<<” ";
}
return 0;
}