This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// model_solution/solution.cpp
#include "aplusb.h"
#include <vector>
#include <set>
std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) {
std::set<std::pair<int,int>> szet; szet.clear();
std::vector<int> pos(N);
for(int i=0; i<N; i++){
pos[i] = 0;
szet.insert({A[i]+B[0],i});
}
std::vector<int> ans(N);
for(int i=0; i<N; i++){
auto it = szet.begin();
ans[i] = (*it).first;
int id = (*it).second;
szet.erase(szet.begin());
if(++pos[id] < N) szet.insert({A[id] + B[pos[id]], id});
}
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... |