This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include<aplusb.h>
using namespace std;
vector<int> smallest_sums(int n,vector<int>a,vector<int>b){
vector<int>ans;
set<pair<int,pair<int,int>>>s;
s.insert({a[0]+b[0],{0,0}});
for(int i=0;i<n-1;i++){
pair<int,pair<int,int>>pr=*s.begin();
s.erase(s.begin());
ans.push_back(pr.first);
s.insert({a[pr.second.first+1]+b[pr.second.second],{pr.second.first+1,pr.second.second}});
s.insert({a[pr.second.first]+b[pr.second.second+1],{pr.second.first,pr.second.second+1}});
}
ans.push_back((*s.begin()).first);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |