# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430447 | Icebear16 | The Big Prize (IOI17_prize) | C++14 | 144 ms | 288 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int find_best(int n){
vector<int> a;
double j=0,k=n,h;
while((k-j)!=1){
h=ceil(((k-j)/2)+j);
a=ask(h);
if(a[0]==0 && a[1]==0){
return h;
break;
}else if(a[0]<a[1]){
if(h==n-2){
return (n-1);
break;
}
j=ceil((k-j)/2);
}else if(a[0]>a[1]){
if(h==1){
return 0;
break;
}
k=ceil(((k-j)/2)+j);
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |