이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int HC(int N){
int b[2] = {1,N};
Guess(b[1]);
for(int w = 0, r; b[0] < b[1]; w ^= 1){
r = Guess(b[w]);
//printf("N = %d, [%d, %d], res = %d\n",N,b[w],b[!w],r);
if(!r) return (b[0] + b[1]) / 2;
if(r == -1){
if(b[1] - b[0] == 1) return b[!w];
Guess(b[!w]);
b[w] = (b[0] + b[1] + !w) / 2;
w = !w;
}
else{
if(b[1] - b[0] == 1) return b[w];
b[!w] = (b[0] + b[1] + w) / 2;
}
}
return b[0];
}
| # | 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... |