Submission #239455

# Submission time Handle Problem Language Result Execution time Memory
239455 2020-06-15T16:29:09 Z DavidDamian Hotter Colder (IOI10_hottercolder) C++11
0 / 100
787 ms 62796 KB
#include "grader.h"
///Subtask 2
///Binary Search
int HC(int N){
    int L=2,R=N;
    int ans=N;
    while(L<=R){
        if(L==R)
            return L;
        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:11:13: warning: unused variable 'previous' [-Wunused-variable]
         int previous=Guess(mid-1);
             ^~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 8184 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 8192 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 8184 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 787 ms 62796 KB Output isn't correct - alpha = 0.000000000000