답안 #1088396

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1088396 2024-09-14T10:26:13 Z MateiKing80 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[])
{
    sort(a, a + n);
    sort(b, b + n);
    vector<int> x;
    for(int i = 0; i < n; i ++)
        for(int j = 0; j < n / (i + 1); j ++)
            x.push_back(a[i] + b[j]);
    sort(all(x));
    int ans[100005];
    for(int i = 0; i < n; i ++)
        ans[i] = x[i];
    return ans;
}

Compilation message

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