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 a[100005];
long long findGap(int t, int n)
{
if (t==1)
{
long long l=1, r=1e18, ans=0;
for (int i=1; i<=n/2; i++)
{
MinMax(l, r, &a[i], &a[n-i+1]);
l=a[i]+1;
r=a[n-i+1]-1;
}
if (n&1)
MinMax(l, r, &a[n/2+1], &a[n/2+1]);
for (int i=1; i<n; i++)
ans=max(ans, a[i+1]-a[i]);
return ans;
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
22 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |