Submission #201745

# Submission time Handle Problem Language Result Execution time Memory
201745 2020-02-11T22:27:03 Z Leonardo_Paes Hotter Colder (IOI10_hottercolder) C++17
0 / 100
615 ms 140280 KB
#include "grader.h"
 
int HC(int n){
    int ini = 1, fim = n , meio, ans = -1;
        
    while(ini<=fim){
        meio = (ini + fim) >> 1;
        
        if(ini == fim){
            ans = meio;
            break;
        }
        
        Guess(ini);
        int a = Guess(fim);
        
        if(a == 0){
            ans = meio;
            break;
        }
        else if(a == 1){
            ini = meio + 1;
        }
        else{
            fim = meio - 1 + (fim - ini)&1;
        }
    }
 
    return ans;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:25:28: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
             fim = meio - 1 + (fim - ini)&1;
                   ~~~~~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 17532 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 17528 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 17552 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 615 ms 140280 KB Output isn't correct - alpha = 0.000000000000