# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
560884 | fdnfksd | Gap (APIO16_gap) | C++14 | 47 ms | 1864 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<bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
ll a[100009];
ll findGap(int t, int n)
{
if(t==1)
{
a[0]=-1;
a[n+1]=2e18+10;
ll i=1,j=n;
while(i<=j)
{
MinMax(a[i-1]+1,a[j+1]-1,&a[i],&a[j]);
i++;
j--;
}
ll res=0;
for(int i=2;i<=n;i++) res=max(res,a[i]-a[i-1]);
return res;
}
}/*
int main()
{
findGap();
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |