Submission #26755

# Submission time Handle Problem Language Result Execution time Memory
26755 2017-07-05T11:55:22 Z baactree Hotter Colder (IOI10_hottercolder) C++14
0 / 100
949 ms 140240 KB
#include "grader.h"

int HC(int N){
    int le,ri;
    le=1;
    ri=N;
    int pre=-1000;
    while(true){
        if(le==ri)
            return le;
        int mid=(le+ri)/2;
        int x=2*mid-pre;
        if(x==pre)
            x++;
        if(x>=le&&x<=ri){
            int k=Guess(x);
            if(k==0)
                return (x+pre)/2;
            else if(k>1){
                if(x<pre){
                    ri=(x+pre)/2-((x+pre)%2==0);
                    pre=x;
                }
                else{
                    le=(x+pre)/2+1;
                    pre=x;
                }
            }
            else{
                if(x<pre){
                    le=(x+pre)/2+1;
                    pre=x;
                }
                else{
                    ri=(x+pre)/2-((x+pre)%2==0);
                    pre=x;
                }
            }
        }
        else{
            x=(le*2+ri)/3;
            Guess(x);
            pre=x;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 17528 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 17400 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 50 ms 17528 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 949 ms 140240 KB Output isn't correct - alpha = 0.000000000000