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;
typedef long long int ll;
constexpr int N = 1e5;
int p[N+9];
std::vector<int> smallest_sums(int n, std::vector<int> a, std::vector<int> b) {
priority_queue<pair<int,int>> ter;
for (int x=0;x<n;x++){
p[x]=0;
ter.push({-(a[x]+b[0]),x});
}
b.push_back(2e9);
vector<int> odp;
for (int x=0;x<n;x++){
pair<int,int> t=ter.top(); ter.pop();
odp.push_back(-t.first);
p[t.second]++;
ter.push({-(a[t.second]+b[p[t.second]]),t.second});
}
return odp;
}
# | 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... |