답안 #896424

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
896424 2024-01-01T12:23:38 Z SuPythony A Plus B (IOI23_aplusb) C++17
컴파일 오류
0 ms 0 KB
#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

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) {
      |       ^~~~~~~~~~~~~