#include "grader.h"
int HC(int N){
if (N == 1)return N;
int left = 1;
int right = N;
Guess(1);
if (N == 2) {
if (Guess(2) == 1)return 2;
return 1;
}
int mid = (left + right) / 2;
while (left < right) {
mid = (left + right) / 2;
int query = Guess(mid);
if (query == 1) {//hotter
left = mid+1;
}
else if (query == -1) {//colder
right = mid-1;
}
else {// same
right = mid - 1;
left = left + 1;
}
}
if (right < left)return right;
if (Guess(left) == -1)return mid;
while(Guess(--left));
return left+1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
109 ms |
33912 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
121 ms |
33964 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
110 ms |
33912 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10004 ms |
8732 KB |
Time limit exceeded |