# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1090601 | damas_code | Hotter Colder (IOI10_hottercolder) | C++17 | 533 ms | 57608 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>
#include "grader.h"
using namespace std;
int HC(int N){
int l = 0, r = N-1; // it will return same
int pg = r;
int pp = Guess(pg);
int g = (l+r)/2;
int p = Guess(g);
if (p == 1) r = ((pg + g)/2) -1; //hotter
else if (p == 0) return (pg + g)/2; //same
else l = ((pg + g)/2) +1; //colder
while (l < r){
int pg = r;
int pp = Guess(pg);
int g = (l+r)/2;
int p = Guess(g);
if (p == 1) r = ((pg + g)/2) -1; //hotter
else if (p == 0) return (pg + g) /2; //same
else l = ((pg + g)/2) +1; //colder
}
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... |