This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
int find_best(int n) {
int i = 0;
for (int jumpSize = 30; jumpSize >= 0; jumpSize--)
{
if (i + (1<<jumpSize) < n && ask(i + (1<<jumpSize))[1] == 1) i += (1<<jumpSize);
}
if (ask(i)[1] == 1) return i + 1;
else return i;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |