Submission #400617

#TimeUsernameProblemLanguageResultExecution timeMemory
400617FalconGap (APIO16_gap)C++17
70 / 100
66 ms1200 KiB
#include "gap.h" #include <algorithm> #include <iostream> long long findGap(int, int N) { long long a1{}, aN{}; MinMax(0, (long long)1e18, &a1, &aN); long long d = (aN - a1 + N - 2) / (N - 1), ans = d; for(long long i = a1, p = a1; i <= aN; i += d + 1) { long long s{}, e{}; MinMax(i, std::min(i + d, aN), &s, &e); if(~s) ans = std::max(ans, s - p), p = e; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...