답안 #738472

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
738472 2023-05-08T20:07:21 Z Elvin_Fritl 커다란 상품 (IOI17_prize) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#include "prize.h"

int find_best(int n) {
	int l=0,r=n-1;
	while(l<=r){
        int mid=(l+r)>>1;
        int a[2]=ask(mid);
        if(a[0] == a[1] && a[0] == 0){
            return mid;
        }
        if(a[0]==0){
            l=mid+1;
        }
        else{
            r=mid-1;
        }
	}
	return 0;
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:9:21: error: array must be initialized with a brace-enclosed initializer
    9 |         int a[2]=ask(mid);
      |                  ~~~^~~~~