Submission #231105

# Submission time Handle Problem Language Result Execution time Memory
231105 2020-05-12T17:29:05 Z muhammad_hokimiyon Hotter Colder (IOI10_hottercolder) C++14
0 / 100
381 ms 16488 KB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

int HC(int nn)
{
    int Q = 0;
    int ls1 = 0;
    int l = 1 , r = nn;
    while( l < r ){
    int m = (l + r) / 2;
    int y2 = Guess( m + 1 );
    Q += 1;
    if( y2 == -1 && ls1 <= m + 1 ){
        r = m;
        ls1 = m + 1;
        continue;
    }
    if( y2 == -1 && ls1 >= m + 1 ){
        l = m + 1;
        ls1 = m + 1;
        continue;
    }
    if( y2 == 1 ){
        if( ls1 >= m + 1 ){
            r = (m + 1 + ls1) / 2;
        }
        else{
            l = (m + 1 + ls1) / 2;
        }
        continue;
    }
    Q += 1;
    int y1 = Guess( m );
    ls1 = m;
    if( y1 == -1 )l = m + 1;
    else r = m;
    }
    assert( Q <= 16 );
    return l;
}
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 2432 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 2560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 2560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# Verdict Execution time Memory Grader output
1 Runtime error 381 ms 16488 KB Execution killed with signal 11 (could be triggered by violating memory limits)