Submission #989896

#TimeUsernameProblemLanguageResultExecution timeMemory
989896qwerasdfzxclHotter Colder (IOI10_hottercolder)C++17
80.56 / 100
420 ms8032 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; mt19937 rng(1557); int HC(int N){ int l = 1, r = N, p = -1; while(l<r){ bool flagL = (p<=l && r+l-p<=N); bool flagR = (p>=r && r+l-p>=1); if (!flagL && !flagR){ if (rng()&1) p = l, Guess(p), flagL = true; else p = r, Guess(p), flagR = true; } int ret; if (flagL){ p = r+l-p, ret = Guess(p); if (ret==0) return (l+r) / 2; else if (ret==1) l = (l+r) / 2 + 1; else r = (l+r-1) / 2; } else{ p = r+l-p, ret = Guess(p); if (ret==0) return (l+r) / 2; else if (ret==-1) l = (l+r) / 2 + 1; else r = (l+r-1) / 2; } } return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...