Submission #146298

# Submission time Handle Problem Language Result Execution time Memory
146298 2019-08-23T11:14:55 Z popovicirobert Hotter Colder (IOI10_hottercolder) C++14
0 / 100
709 ms 128376 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

int HC(int n){
    if(n == 1) {
        return 1;
    }
    int res = 0, last = 0, cnt = 0;
    for(int step = 1 << 8; step; step >>= 1) {
        if(res + step <= n) {
            int cur = Guess(res + step);
            cnt++;
            if(cnt == 1) {
                last = res + step - 1;
                if(Guess(res + step - 1) == -1) {
                    res += step;
                }
            }
            else {
                if(cur == 0) {
                    return (last + res + step) / 2;
                }
                last = res + step - 1;
                if(res + step > 1 && Guess(res + step - 1) == -1) {
                    res += step;
                }
            }
        }
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 5496 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 5368 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 5368 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 709 ms 128376 KB Output isn't correct - alpha = 0.000000000000