# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1053280 | Unforgettablepl | The Big Prize (IOI17_prize) | C++17 | 40 ms | 600 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 "prize.h"
#include <bits/stdc++.h>
using namespace std;
const int THRESHOLD = 400;
const int BIGGER_JUMP = 131072;
int find_best(int n){
for(int i=0;i<n;i++) {
auto base = ask(i);
int curr = base[0]+base[1];
if(curr==0)return i;
if(curr>THRESHOLD) {
for(int jump=BIGGER_JUMP;jump;jump/=2) {
if(i+jump>=n)continue;
auto temp = ask(i+jump);
if(temp==base)i+=jump;
}
} else {
for(int jump=256;jump;jump/=2) {
if(i+jump>=n)continue;
auto temp = ask(i+jump);
if(temp==base)i+=jump;
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |