# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596926 | keta_tsimakuridze | Hotter Colder (IOI10_hottercolder) | C++14 | 754 ms | 8104 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<bits/stdc++.h>
#define f first
#include "grader.h"
//#include "hottercolder.h"
#define s second
#define pii pair<int,int>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7; // !
int t;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int a, int b) {
return a + (unsigned long long)rng() % (b - a + 1);
}
int HC(int n) {
int l = 1, r = n, ans = 1, last = -1;
while(l != r) {
if(last == l || (last != r && rand(1, 2000000000) % 2)) {
if(last != l) Guess(l);
int x = Guess(r); last = r;
if(!x) return (l + r) / 2;
if(x == 1) l = (l + r) / 2 + 1;
else r = (l + r) / 2 - 1 + (l + r) % 2;
continue;
}
if(last != r) Guess(r);
int x = Guess(l); last = l;
if(!x) return (l + r) / 2;
if(x == -1) l = (l + r) / 2 + 1;
else r = (l + r) / 2 - 1 + (l + r) % 2;
}
return l;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |