Submission #222290

#TimeUsernameProblemLanguageResultExecution timeMemory
222290mathking1021Hotter Colder (IOI10_hottercolder)C++11
77 / 100
708 ms24568 KiB
#include "grader.h"

int HC(int N)
{
    int lt = 1, rt = N;
    while(lt < rt)
    {
        Guess(lt);
        int t = Guess(rt);
        if(t == 0) return (lt + rt) / 2;
        if(t == 1)
        {
            lt = (lt + rt + 2) / 2;
        }
        else
        {
            rt = (lt + rt - 1) / 2;
        }
    }
    return lt;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...