Submission #80287

#TimeUsernameProblemLanguageResultExecution timeMemory
80287MoNsTeR_CuBeThe Big Prize (IOI17_prize)C++17
Compilation error
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[] = ask(mid); if(tab[0]==1){ right = mid-1; }else if(tab[0] == 1){ left = mid+1; }else{ right = mid; break; } } return right; }

Compilation message (stderr)

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