Submission #119608

# Submission time Handle Problem Language Result Execution time Memory
119608 2019-06-21T12:50:30 Z Plurm Hotter Colder (IOI10_hottercolder) C++11
0 / 100
10000 ms 8064 KB
#include "grader.h"
#include <cstdio>
int HC(int N){
    int lo = 1;
    int hi = N;
    while(hi - lo < 10){
        Guess(lo);
        int r = Guess(hi);
        if(r > 0){
            lo = (lo + hi)/2 + 1;
        }else if(r == 0){
            return (lo + hi)/2;
        }else{
            hi = (lo + hi - 1)/2;
        }
    }
    int last = -1;
    for(int i = lo; i <= hi; i += 2){
        int cur = Guess(i);
        if(last == -1){
            last = cur;
            continue;
        }
        if(cur == -1) return i-2;
        if(cur == 0) return i-1;
        last = cur;
    }
    return hi;
}
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 1276 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 1272 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 1504 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 10076 ms 8064 KB Time limit exceeded