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;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
using vi = vector<int>;
using tint = long long;
using vl = vector<tint>;
long long findGap(int T, int n)
{
if(T == 1){
vl a(n);
int l = 0, r = n-1;
tint L = 0, R = 1e18;
while(l <= r){
MinMax(L, R, &L, &R);
a[l] = L; a[r] = R;
++L; --R;
++l; --r;
}
tint maxi = 0;
F0R(i, n-1) maxi = max(maxi, a[i+1] - a[i]);
return maxi;
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
28 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |