Submission #1012399

#TimeUsernameProblemLanguageResultExecution timeMemory
1012399huutuanHotter Colder (IOI10_hottercolder)C++14
50 / 100
640 ms8240 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(69420); int HC(int N){ int l=1, r=N; int cnt=0; int lst=0; while (l<=r){ int mid=(l+r)>>1; if (l==r) return mid; int t=0; if (lst==l){ t=Guess(r); lst=r; }else if (lst==r){ t=-Guess(l); lst=l; }else if (uniform_int_distribution<int>(0, 1)(rng)){ Guess(l); t=Guess(r); lst=r; }else{ Guess(r); t=-Guess(l); lst=l; } if (!t) return mid; if (t==1) l=mid+1; else r=mid; } return -1; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:8: warning: unused variable 'cnt' [-Wunused-variable]
   11 |    int cnt=0;
      |        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...