Submission #330898

#TimeUsernameProblemLanguageResultExecution timeMemory
330898jovan_bGap (APIO16_gap)C++17
70 / 100
62 ms1260 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1000000000000000000LL; long long findGap(int T, int N){ ll mn, mx; MinMax(1, INF, &mn, &mx); ll block = (mx-mn+N-2)/(N-1); ll res = block; ll posl = mn; ll i; for(i=mn; i+block+1 <= mx; i += block+1){ ll a, b; MinMax(i, i+block+1, &a, &b); if(a == -1) continue; res = max(res, a-posl); posl = b; } ll a, b; MinMax(i, mx, &a, &b); if(a != -1) res = max(res, a-posl); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...