Submission #239449

# Submission time Handle Problem Language Result Execution time Memory
239449 2020-06-15T15:56:21 Z DavidDamian Hotter Colder (IOI10_hottercolder) C++11
50 / 100
736 ms 8296 KB
#include "grader.h"
///Subtask 2
///Binary Search
int HC(int N){
    int L=2,R=N;
    int ans=N;
    while(L<=R){
        int mid=(L+R)/2;
        int previous=Guess(mid-1);
        int act=Guess(mid);
        if(act==-1){
            ans=mid-1;
            R=mid-1;
        }
        else{
            L=mid+1;
        }
    }
    return ans;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:9:13: warning: unused variable 'previous' [-Wunused-variable]
         int previous=Guess(mid-1);
             ^~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 37 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 1280 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 736 ms 8296 KB Output isn't correct - alpha = 0.000000000000