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 "aplusb.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define no cout<<"NO"<<endl
#define yes cout<<"YES"<<endl
const ll mod=998244353;
vector<int> smallest_sums(int n, vector<int>arr1, vector<int>arr2){
sort(arr2.begin(), arr2.end());
sort(arr1.begin(), arr1.end());
int g=0;
int h=0;
vector <int> result(100'000);
for(int i=0 ; i<n ; i++){
result[i]=arr1[g]+arr2[h];
if(arr1[g+1]+arr2[h]>arr1[g]+arr2[h+1]){
h++;
}
else{
g++;
}
}
return result;
}
# | 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... |