Submission #117926

#TimeUsernameProblemLanguageResultExecution timeMemory
117926win11905Gap (APIO16_gap)C++11
48.54 / 100
74 ms1528 KiB
#include <bits/stdc++.h> #include "gap.h" #define long long long using namespace std; long MX = 1e18; long findGap(int T, int N) { long mn, mx; MinMax(0, MX, &mn, &mx); long sz = (mx-mn+N-2) / (N-1); long ans = sz; long pv = mn; long z = mx; long p = mn; while(p <= z) { MinMax(p, p+sz, &mn, &mx); if(mn != -1) { ans = max(ans, mn - pv); pv = mx; } p += sz; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...