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;
std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B)
{
set<pair<int, pair<int, int>>> st;
for (int i = 0; i < N; i++)
st.insert({B[i] + A[0], {1, i}});
vector<int> ans(N);
for (int i = 0; i < N; i++)
{
auto it = st.begin();
ans[i] = ((*it).first);
st.erase(it);
st.insert({B[(*it).second.second] + A[(*it).second.first], {(*it).second.first + 1, (*it).second.second}});
}
sort(ans.begin(), ans.end());
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... |