| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1331060 | hectormedrano | Hotter Colder (IOI10_hottercolder) | C++20 | 420 ms | 8296 KiB |
#include <bits/stdc++.h>
#include "grader.h"
//#include "hottercolder.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
int HC(int N){
ll L, R;
L = 0;
R = N+1;
while(R - L > 2){
ll M = (L+R)/2;
Guess(M-1);
ll w = Guess(M+1);
if(w == 0){return M;}
if(w == 1){L = M;}
if(w == -1){R = M;}
}
if(L==0){
Guess(L+1);
ll w = Guess(L+2);
if(w == 1){return L+2;}
if(w == -1){return L+1;}
}
if(R==N+1){
Guess(R-1);
ll w = Guess(R-2);
if(w == 1){return R-2;}
if(w == -1){return R-1;}
}
Guess(L);
ll w = Guess(R);
if(w == 0){return L+1;}
if(w == 1){return R;}
if(w == -1){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... | ||||
