Submission #708563

#TimeUsernameProblemLanguageResultExecution timeMemory
708563yuuhiGap (APIO16_gap)C++14
0 / 100
45 ms1864 KiB
#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 = 1e18 ; for (int i = 1 ; i < n ; ++ i) ans = min(ans , a[i + 1] - a[i]) ; return ans ; } else { return 1 ; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...