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"
#define f first
#define s second
#define double long double
#define _size(x) ((int)((x).size()))
using namespace std ;
typedef pair< int , int > ii ;
long long findGap (int T , int n) {
if (T == 1) {
vector< long long > a(n + 5) ;
long long l = 0 , r = 1e18 ;
for (int i = 1 ; i <= (n + 1) / 2 ; ++ i) {
MinMax(l , r , &a[i] , &a[n - i + 1]) ;
l = a[i] + 1 ; r = a[n - i + 1] - 1 ;
}
long long ans = 0 ;
for (int i = 1 ; i < n ; ++ i) ans = max(ans , a[i + 1] - a[i]) ;
return ans ;
}
else {
return 1 ;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |