# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881707 | spdling | A Plus B (IOI23_aplusb) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
int[] smallest_sums(int N, int[] A, int[] B) {
int* ans = new int[N]();
int ans_n = 0;
int i = 0, j = 0;
while (ans_n < N) {
ans[ans_n] = A[i] + B[j];
ans_n++;
if (A[i] + B[j+1] < A[i+1] + B[j]) {
++j;
} else {
++i;
}
}
return ans;
}