Submission #722421

#TimeUsernameProblemLanguageResultExecution timeMemory
722421tvladm2009The Big Prize (IOI17_prize)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; typedef long long ll; int find_best(int N) { int l = 1, r = N; while (l < r) { int mid = (l + r) / 2; int cnt[] = ask(mid); if (cnt[0] == 0 && cnt[1] == 0) { return mid; } else if (cnt[0] < cnt[1]) { l = mid + 1; } else { r = mid; } } return l; }

Compilation message (stderr)

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