Submission #512648

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

**/

#include <bits/stdc++.h>

#include "grader.h"

using namespace std;

typedef long long ll;

mt19937 rnd (time(0));

int Guess (int x);

int HC (int N) {
    int l = 1, r = N;
    int x = 1, y = N;
    Guess(x);
    while (l < r) {
        int mid = (l + r) / 2;
        int g = Guess(y);
        if (g == 0) {
            return mid;
        }
        if (x < y) {
            if (g == -1) {
                r = mid;
                x = l, y = r;
                if (rnd() % 2) {
                    swap(x, y);
                }
                Guess(x);
            } else {
                l = mid + 1;
                x = y;
                y = l;
            }
        } else {
            if (g == -1) {
                l = mid + 1;
                x = l, y = r;
                if (rnd() % 2) {
                    swap(x, y);
                }
                Guess(x);
            } else {
                r = mid;
                x = y;
                y = r;
            }
        }
    }
    return l;
}
# Verdict Execution time Memory Grader output
1 Correct 25 ms 1300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 1228 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 1228 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 707 ms 8104 KB Output isn't correct - alpha = 0.000000000000