제출 #1329912

#제출 시각아이디문제언어결과실행 시간메모리
1329912exoworldgdCoreputer (IOI23_coreputer)C++20
컴파일 에러
0 ms0 KiB
#include"coreputer.h"
#include<bits/stdc++.h>
#define ll long long
#define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0)
using namespace std;
int[] malfunctioning_cores(int n){
    int a[n],l=0,r=n-1;
    while(l<r) {
        int m=(l+r)>>1,v[m+1];
		iota(v,v+m+1,0),run_diagnostic(v,m+1)<0?l=m+1:r=m;
    }a[l]=1;
    if(l<n-1)a[n-1]=1;
    for(int i=0;i<l;i++) {
        int v[n-l];
		v[0]=i,iota(v+1,v+n-l,l+1);
        if(run_diagnostic(v,n-l)>0)a[i]=1,a[n-1]^=1;
    }
    for(int i=l+1;i<n-1;i++) {
        int v[l+1];
        v[0]=i,iota(v+1,v+l+1,0);
        if(run_diagnostic(v,l+1)>=0)a[i]=1,a[n-1]^=1;
    }
    return a;
}

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

coreputer.cpp:6:4: error: structured binding declaration cannot have type 'int'
    6 | int[] malfunctioning_cores(int n){
      |    ^~
coreputer.cpp:6:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coreputer.cpp:6:4: error: empty structured binding declaration
coreputer.cpp:6:7: error: expected initializer before 'malfunctioning_cores'
    6 | int[] malfunctioning_cores(int n){
      |       ^~~~~~~~~~~~~~~~~~~~