Submission #896424

#TimeUsernameProblemLanguageResultExecution timeMemory
896424SuPythonyA Plus B (IOI23_aplusb)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int[] smallest_sums(int N, int[] A, int[] B) {
    vector<int> ans;
    int s=0, a=0, b=0;
    while (s<N) {
        ans.push_back(A[a]+B[b]);
        s++
        if (A[a+1]<=B[b+1]) a++;
        else b++;
    }
    return ans;
}

Compilation message (stderr)

aplusb.cpp:4:4: error: structured binding declaration cannot have type 'int'
    4 | int[] smallest_sums(int N, int[] A, int[] B) {
      |    ^~
aplusb.cpp:4:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
aplusb.cpp:4:4: error: empty structured binding declaration
aplusb.cpp:4:7: error: expected initializer before 'smallest_sums'
    4 | int[] smallest_sums(int N, int[] A, int[] B) {
      |       ^~~~~~~~~~~~~