Submission #10086

# Submission time Handle Problem Language Result Execution time Memory
10086 2014-10-10T07:34:59 Z gyunt Hotter Colder (IOI10_hottercolder) C++
0 / 100
2247 ms 262144 KB
#include <iostream>
#include "grader.h"

using namespace std;

int HC(int n)
{
    int min = 1, max = n, previous_guess = 1, guess = 0, hot_cool;
    Guess(1);
    
    while (min < max)
    {
        guess = min + max - previous_guess;
        hot_cool = Guess(guess);
        
        if (hot_cool == 0)
        {
            return ((previous_guess + guess) >> 1);
        }
        
        int mid = (previous_guess + guess) / 2;
        int mod = (previous_guess + guess) & 1;
        
        if (hot_cool > 0)
        {
            if (guess > previous_guess)
                min = mid + mod;
            else
                max = mid;
        }
        else
        {
            if (guess > previous_guess)
                max = mid;
            else
                min = mid + mod;
        }
        
        previous_guess = guess;
    }
    return min;
}
# Verdict Execution time Memory Grader output
1 Incorrect 155 ms 59128 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 110 ms 59236 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 119 ms 59128 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2247 ms 262144 KB Output isn't correct - alpha = 0.000000000000