Submission #750893

#TimeUsernameProblemLanguageResultExecution timeMemory
750893M_WGap (APIO16_gap)C++17
59.12 / 100
88 ms5708 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; long long findGap(int T, int N){ long long L, R; MinMax(1, 1e18, &L, &R); long long X = (R - L) / ((N * 1ll) - 1); X += (R - L) % ((N * 1ll) - 1) != 0; long long qs, qt; set<long long> s; for(long long i = L + 1; i <= R; i += X){ MinMax(i, i + X, &qs, &qt); s.insert(qs); s.insert(qt); } s.erase(-1ll); long long ans = 0, old = L; for(auto x : s){ ans = max(ans, x - old); old = x; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...