# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137053 | 2019-07-27T03:11:50 Z | tinjyu | Hotter Colder (IOI10_hottercolder) | C++14 | 801 ms | 8288 KB |
#include "grader.h" #include <iostream> using namespace std; int HC(int N){ if(N==1)return 1; long long int n=N; int mid=n/2; long long int l=1,r=n,a=-1,pre=n; while(true) { if(l==r)return l; Guess(r); pre=r; int mid=l; long long int tmp=Guess(mid); //cout<<l<<" "<<r<<" "<<mid<<" "<<pre<<" "<<tmp<<endl; if(tmp==1) { if(pre>mid) { r=(mid+pre)/2; if((mid+pre)%2==0)r--; } else { l=(mid+pre)/2+1; } } if(tmp==-1) { if(pre>mid) { l=(mid+pre)/2+1; } else { r=(mid+pre)/2; if((mid+pre)%2==0)r--; } } if(tmp==0)return (mid+pre)/2; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 1272 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 1272 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 1272 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 801 ms | 8288 KB | Output is partially correct - alpha = 0.068965517241 |