#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int vez;
int HC(int n)
{
if (n == 1) return 1;
int ini = 1, fim = n;
while (ini < fim)
{
if (fim-ini == 1)
{
Guess(ini);
int g = Guess(fim);
return (g == -1 ? ini : fim);
}
Guess(ini);
int g = Guess(fim);
if (g == 0) return (ini+fim)/2;
else if (g == 1) ini = (ini+fim)/2 + 1;
else
{
int ant = fim;
fim = (ini+fim)/2;
if ((ini+ant)%2 == 0) fim--;
}
}
return ini;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
1276 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
1400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
755 ms |
11128 KB |
Output is partially correct - alpha = 0.068965517241 |