Submission #512640

# Submission time Handle Problem Language Result Execution time Memory
512640 2022-01-16T15:16:26 Z alextodoran Hotter Colder (IOI10_hottercolder) C++17
25 / 100
562 ms 8096 KB
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

#include "grader.h"

using namespace std;

typedef long long ll;

int Guess (int x);

int HC (int N) {
    int l = 1, r = N;
    int x = (l * 2 + r) / 3, y = (l + r * 2 + 2) / 3;
    Guess(x);
    while (l < r) {
        int g = Guess(y);
        if (g == 0) {
            return (x + y) / 2;
        }
        if (x < y) {
            if (g == +1) {
                l = (x + y) / 2 + 1;
                x = y;
                y = (l + r * 2 + 2) / 3;
            } else {
                r = (x + y) / 2;
                x = (l * 2 + r) / 3;
                Guess(x);
                y = (l + r * 2 + 2) / 3;
            }
        } else {
            if (g == -1) {
                r = (x + y) / 2;
                x = y;
                y = (l * 2 + r) / 3;
            } else {
                l = (x + y) / 2 + 1;
                x = (l * 2 + r) / 3;
                Guess(x);
                y = (l + r * 2 + 2) / 3;
            }
        }
    }
    return l;
}
# Verdict Execution time Memory Grader output
1 Correct 19 ms 1228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 1228 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 1288 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 562 ms 8096 KB Output isn't correct - alpha = 0.000000000000