| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1232079 | jasonic | Hotter Colder (IOI10_hottercolder) | C++20 | 389 ms | 8240 KiB |
#include <bits/stdc++.h>
using namespace std;
#include "grader.h"
int HC(int n){
if(n == 1) return 1;
Guess(1);
bool lastleft = true;
int l = 1, r = n;
while(l < r) {
int d = (r-l+1)/2;
int x;
if(lastleft) {
x = Guess(r);
// printf("%d %d %d %d\n", l, r, x, lastleft);
if(x == 0) return (l+r)/2;
if(x == -1) {
r = l + d - 1;
Guess(r);
}
else l = r - d;
} else {
x = Guess(l);
// printf("%d %d %d %d\n", l, r, x, lastleft);
if(x == 0) return (l+r)/2;
if(x == -1) {
l = r - d + 1;
Guess(l);
}
else r = l + d;
}
lastleft = !lastleft;
}
// printf("%d %d\n", l, r);
return l;
}| # | 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... | ||||
