Submission #319567

# Submission time Handle Problem Language Result Execution time Memory
319567 2020-11-05T14:07:24 Z ehdtjskaqhd Hotter Colder (IOI10_hottercolder) C++17
0 / 100
728 ms 45028 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int N)
{
    if (N == 1) return 1;
    if (N == 2) return Guess(1), ~Guess(2) ? 2 : 1;
    int l = 1, r = N, res = -2, lg = -1;
    auto gs = [&](int g) -> int {return Guess(lg = g);};
    while (r - l > 1)
    {
        if (lg == l) res = gs(r);
        else if (lg == r) res = -gs(l);
        else gs(l), res = gs(r);
        int mid = (l + r) / 2, adj = (l + r) % 2;
        if (!res) return mid;
        else if (~res) l = mid + adj;
        else r = mid;
    }
    return res > 0 ? r : l;
}
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 6756 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 6756 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 6756 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 728 ms 45028 KB Output isn't correct - alpha = 0.000000000000