| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 103210 | daniel920712 | The Big Prize (IOI17_prize) | C++14 | 63 ms | 3552 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 <math.h>
#include <assert.h>
#include "prize.h"
using namespace std;
int all[200005];
int l[200005],r[200005];
int find_best(int n)
{
vector < int > t;
int i,x=floor(sqrt(n)),j,all=0;
for(i=0;i<n;i+=x)
{
//printf("%d\n",i);
t=ask(i);
all++;
l[i]=t[0];
r[i]=t[1];
if(l[i]==0&&r[i]==0) return i;
}
for(i=x;i<n;i+=x)
{
if(i+x>=n&&r[i])
{
for(j=i+1;j<n;j++)
{
all++;
assert(all<10000);
t=ask(j);
l[j]=t[0];
r[j]=t[1];
if(l[j]==0&&r[j]==0) return j;
}
}
else
{
if(r[i]!=r[i+x])
{
for(j=i+1;j<i+x;j++)
{
all++;
assert(all<10000);
t=ask(j);
l[j]=t[0];
r[j]=t[1];
if(l[j]==0&&r[j]==0) return j;
}
}
}
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
