| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 443154 | hossain2020 | Gap (APIO16_gap) | C++14 | 53 ms | 1868 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 "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long v[1000005],i,j;
long long findGap(int T, int N)
{
j=0;
i=N-1;
long long c=0,d=1e18;
long long *a=&c,*b=&d;
while (i>j)
{
MinMax(c,d,a,b);
if (*a+*b==-2)break ;
v[j]=*a;
v[i]=*b;
i--;
j++;
c=*a;
c++;
*a=c;
d=*b;
d--;
*b=d;
}
if (N%2==1)
{
d++;
*b=d;
MinMax(c,d,a,b);
v[i]=*a;
}
long long o=0;
for (int i=1;i<N;i++)
{
o=max(o,v[i]-v[i-1]);
}
return o;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
