Submission #882389

#TimeUsernameProblemLanguageResultExecution timeMemory
882389dubabubaGap (APIO16_gap)C++14
0 / 100
33 ms4656 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define ff first #define ss second ll findGap(int T, int N) { ll L, R; MinMax(0LL, (ll)1e18, &L, &R); ll d = (R - L) / N; ll mn[N], mx[N]; mn[0] = L, mx[N - 1] = R; ll st = L; for(int i = 0; i < N; i++) MinMax(st, (i == N - 1) ? N - 1 : st + d - 1, &mn[i], &mx[i]); ll ans = 0; for(int i = 1; i < N; i++) ans = max(ans, mn[i] - mx[i - 1]); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...