# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
566413 | Temmie | The Big Prize (IOI17_prize) | C++17 | 1 ms | 208 KiB |
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 "public_a/cpp/prize.h"
#include "prize.h"
#include <bits/stdc++.h>
int find_best(int n) {
if (!ask(0)[1]) {
return 0;
}
int ans = 0;
for (int b = 21; ~b; b--) {
if (ans | (1 << b) >= n) {
continue;
}
if (!ask(ans | (1 << b))[0]) {
ans |= 1 << b;
}
}
return ans + 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |