제출 #80288

#제출 시각아이디문제언어결과실행 시간메모리
80288MoNsTeR_CuBe커다란 상품 (IOI17_prize)C++17
컴파일 에러
0 ms0 KiB
#include "prize.h"
#include <bits/stdc++.h>
 
using namespace std;
 
int find_best(int n) {
   int left = 0;
   int right = n-1;
   while(left < right){
        int mid = (left+right)/2;
        int tab[2] = ask(mid);
       if(tab[0]==1){
            right = mid-1;
       }else if(tab[1] == 1){
            left = mid+1;
       }else{
            right = mid;
            break;
       }
   }
   return right;
}

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

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