Submission #231092

# Submission time Handle Problem Language Result Execution time Memory
231092 2020-05-12T16:42:14 Z muhammad_hokimiyon Hotter Colder (IOI10_hottercolder) C++14
0 / 100
775 ms 137352 KB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

int HC(int nn)
{
    int l = 1 , r = nn;
    if( nn == 2 ){
        int x = Guess(1);
        int y = Guess(2);
        if( y == -1 )return 1;
        return 2;
    }
    while( l < r ){
        int m = (l + r) / 2;
        int y2 = Guess( m );
        if( y2 == -1 || (y2 == 0 && (l > 1 || r < nn)) ){
            r = m;
            continue;
        }
        int y1 = Guess( m + 1 );
        if( y1 == 1 )l = m + 1;
        else r = m;
    }
    return l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:10:13: warning: unused variable 'x' [-Wunused-variable]
         int x = Guess(1);
             ^
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 14716 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 14712 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 14712 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 775 ms 137352 KB Output isn't correct - alpha = 0.000000000000