제출 #1088396

#제출 시각아이디문제언어결과실행 시간메모리
1088396MateiKing80A Plus B (IOI23_aplusb)C++17
컴파일 에러
0 ms0 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

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[])
      |       ^~~~~~~~~~~~~