Submission #978369

#TimeUsernameProblemLanguageResultExecution timeMemory
978369AmrGap (APIO16_gap)C++17
30 / 100
29 ms2228 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define sz size() ll a[300005]; long long findGap(int T, int N) { ll n = N; ll l = 1, r = 1e18; ll l1 = 0,r1 = n-1; while(l1<=r1) { ll fl = l , fr = r; MinMax(fl,fr,&l,&r); a[l1++] = l , a[r1--] = r; l++,r--; } ll mx = 0; //for(int i = 0; i < n; i++) cout << a[i] << " "; cout << endl; for(int i = 1; i < n; i++) mx = max(mx,a[i]-a[i-1]); return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...