We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I tried to implement your algorithm but I am getting half test cases as wrong answer. Can you help?
include
using namespace std;
int main() {
int n;
vectora;
cin>>n;
int u,temp1;
maph;
for(u=0;u>temp1;
a.push_back(temp1);
h[temp1]=u;
}
vectorb(a.begin(),a.end());
vectorc(a.begin(),a.end());
sort(b.begin(),b.end());
int count_a=0;
int count_b=0;
int i,j,sec;
for(i=0;i());
for(i=0;i
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Lily's Homework
You are viewing a single comment's thread. Return to all comments →
I tried to implement your algorithm but I am getting half test cases as wrong answer. Can you help?
include
using namespace std;
int main() { int n; vectora; cin>>n; int u,temp1; maph; for(u=0;u>temp1; a.push_back(temp1); h[temp1]=u; } vectorb(a.begin(),a.end()); vectorc(a.begin(),a.end()); sort(b.begin(),b.end()); int count_a=0; int count_b=0; int i,j,sec; for(i=0;i()); for(i=0;i