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>
using namespace std;
vector<int> smallest_sums(int n, vector<int> a, vector<int> b)
{
multiset<int> s;
for (int i =0 ; i<n ; i++) {
s.insert(a[0]+b[i]);
}
int i{1},j{0};
while (a[i] + b[0] < *(--s.end()) && i<n) {
while (a[i] + b[j] < *(--s.end())) {
s.erase(--s.end());
s.insert(a[i]+b[j]);
j++;
}
j=0;
i++;
}
auto it = s.begin();
int k = n;
vector <int> ans;
while (k--)
{
ans.push_back(*it);
it++;
}
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... |