제출 #882391

#제출 시각아이디문제언어결과실행 시간메모리
882391dubabubaGap (APIO16_gap)C++14
0 / 100
46 ms4640 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 + 10, &L, &R); ll d = (R - L) / (ll)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]); st += d; } 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...