I am getting WA for subtasks 8,9 and 11. Unable to figure out the problem. Here is my code.
#include<bits/stdc++.h>#define loop(n) for( i=0;i<n;i++)using namespace std;vector <int> v1,v2;int n,k,a,temp,i,s1,s2;void keep_(){sort(v1.begin(),v1.end(),greater<int>());sort(v2.begin(),v2.end(),greater<int>());if(v1.front()>v2.front()){sort(v1.begin(),v1.end());loop(n){if(v1[i]>v2[i]|| i==k)break;}s1=v1[n-1]+v2[i];sort(v1.begin(),v1.end(),greater<int>());temp=v1[0];v1[0]=v2[n-1];
Read more… (19 words)