This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// time_limit/solution-NsqrtNlogN.cpp
#include "aplusb.h"
#include <vector>
#include <algorithm>
std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) {
int h = std::min(320,N);
std::vector<int> C(N*h*2-h*h);
int pos = 0;
for(int i=0; i<h; i++){
for(int j=0; j<N; j++) C[pos++] = A[i]+B[j];
}
for(int j=0; j<h; j++){
for(int i=h; i<N; i++) C[pos++] = A[i]+B[j];
}
std::sort(C.begin(),C.end());
std::vector<int> ans(N);
for(int i=0; i<N; i++) ans[i] = C[i];
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... |