#include "grader.h"
int HC(int N) {
int left = 1;
int right = N;
while (left <= right) {
if (left == right)
return (left + right) / 2;
if (right - left <= 2)
break;
Guess(left);
int temp = Guess(right);
if (temp == 0) // same
return (left + right) / 2;
if (temp == 1) // hotter
left = (left + right) / 2 + 1;
if (temp == -1) // colder
right = (left + right) / 2;
}
Guess(left);
for (int i = left + 1; i <= right; i++)
if (Guess(i) == -1)
return i - 1;
return right;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1272 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1272 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
37 ms |
1272 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
765 ms |
8184 KB |
Output is partially correct - alpha = 0.034482758621 |