제출 #880257

#제출 시각아이디문제언어결과실행 시간메모리
880257MardonbekhazratovA Plus B (IOI23_aplusb)C++17
컴파일 에러
0 ms0 KiB
int[] smallest_sums(int N,int A[],int B[]){ sort(A,A+N); sort(B,B+N); int l=-1,r=1e18; while(r-l>1){ int mid=(l+r)/2; int ans=0; for(int i=0;i<N;i++){ ans+=upper_bound(B,B+N,mid-A[i])-B; } if(ans>=N) r=mid; else l=mid; } int ans[N]; int j=0; for(int i=0;i<N;i++){ int pos=lower_bound(B,B+N,r-A[i])-B; for(int k=0;k<pos;k++){ ans[j++]=A[i]+B[k]; } } while(j<N) ans[j++]=r; sort(ans,ans+N); return ans; }

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

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