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"
#define ll long long
using namespace std;
const ll N=2e5+9,M=2e18+9,mod=998244353;
vector<int>smallest_sums(int n,vector<int>a,vector<int>b)
{
vector<int>ans;
multiset<ll>s;
for(ll i=0;i<n;++i)
{
if(i==n-1)
{
for(ll j=0;j<n;++j)s.insert(a[i]+b[j]);
break;
}
for(ll j=0;j<n;++j)
{
s.insert(a[i]+b[j]);
if(a[i]+b[j]>a[i+1]+b[0])break;
}
}
ll x=0;
for(auto i:s)
{
ans.push_back(i);
++x;
if(x==n)break;
}
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... |