Submission #556612

# Submission time Handle Problem Language Result Execution time Memory
556612 2022-05-03T12:02:24 Z MohamedFaresNebili Hotter Colder (IOI10_hottercolder) C++14
0 / 100
10000 ms 8140 KB
#include <bits/stdc++.h>
#include "grader.h"

        using namespace std;

        using ll = long long;
        using ii = pair<ll, ll>;
        using vi = vector<int>;

        #define ff first
        #define ss second
        #define pb push_back
        #define all(x) (x).begin(), (x).end()
        #define lb lower_bound
        /// #define int ll

        const int oo = 1e9 + 7;

        int HC(int N) {
            int lo = 1, hi = N, pr = 1; Guess(1);
            while(lo <= hi) {
                int to = (lo + hi) / 2;
                int r = Guess(to), md = abs(to - pr);
                if(to > pr) {
                    if(r == -1) {
                        if(md & 1) hi = md;
                        else hi = md - 1;
                    }
                    if(r == 0) return (to + pr) / 2;
                    if(r == 1) {
                        if(md & 1) lo = md;
                        else lo = md + 1;
                    }
                }
                if(to < pr) {
                    if(r == -1) {
                        if(md & 1) lo = md;
                        else lo = md + 1;
                    }
                    if(r == 0) return (to + pr) / 2;
                    if(r == 1) {
                        if(md & 1) hi = md;
                        else hi = md - 1;
                    }
                }
                pr = to;
            }
            return N;
        }
# Verdict Execution time Memory Grader output
1 Execution timed out 10025 ms 1236 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 10013 ms 1236 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 10029 ms 1236 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 10008 ms 8140 KB Time limit exceeded