| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 103123 | daniel920712 | The Big Prize (IOI17_prize) | C++14 | 3 ms | 512 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 <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "prize.h"
using namespace std;
int all[200005];
int find_best(int n)
{
vector < int > t;
int i,l,r;
t=ask(0);
if(t[0]==0&&t[1]==0) return 0;
t=ask(n-1);
if(t[0]==0&&t[1]==0) return n-1;
l=0;
r=n;
while((r-l)>1)
{
t=ask((l+r)/2);
//printf("%d %d %d %d\n",l,r,t[0],t[1]);
if(t[0]==0&&t[1]==0) return (l+r)/2;
if(t[0]==1) r=(l+r)/2;
else l=(l+r)/2;
}
t=ask(l);
if(t[0]==0&&t[1]==0) return l;
else return r;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
