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