#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int N){
int l = 1, r = N, mid;
int ask = max(N / 2 - 1, 1);
Guess(ask);
while(l < r){
int nask = min(max(l + r - ask, 1), N);
if(nask == ask) nask++;
if(nask > N) nask -= 2;
mid = (ask + nask) / 2;
int g = Guess(nask);
if(ask > nask) g = -g;
if(g == 1) l = mid + 1;
else if(g == -1) r = mid;
else return (ask + nask) / 2;
ask = nask;
}
return l;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
6744 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
6748 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
6772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
422 ms |
8016 KB |
Output isn't correct - alpha = 0.000000000000 |