Submission #718970

#TimeUsernameProblemLanguageResultExecution timeMemory
718970nguyentunglamGap (APIO16_gap)C++17
0 / 100
59 ms1188 KiB
#include<bits/stdc++.h> using namespace std; #include "gap.h" long long findGap(int T, int n) { long long mn, mx; MinMax(0, 1e18, &mn, &mx); long long delta = (mx - mn) / (n - 1) + ((mx - mn) % (n - 1) > 0); long long s = mn + 1, last = mn; long long res = delta, lmt = mx - 1; while (s <= lmt) { long long t = min(lmt, s + delta); MinMax(s, t, &mn, &mx); if (mn != -1) { res = max(res, mn - last); last = mx; } s = t + 1; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...