Submission #536149

#TimeUsernameProblemLanguageResultExecution timeMemory
536149mario05092929Gap (APIO16_gap)C++17
30 / 100
52 ms1864 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[100005]; int lp,rp; long long findGap(int T, int n) { if(T & 1) { ll l = 0, r = 1e18,mn,mx; MinMax(l,r,&mn,&mx); lp = 1, rp = n; while(1) { a[lp++] = mn; a[rp--] = mx; l = mn+1, r = mx-1; if(lp > rp) break; MinMax(l,r,&mn,&mx); } ll mxx = 0; for(int i = 1;i < n;i++) { mxx = max(mxx,a[i+1]-a[i]); } return mxx; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...