제출 #1090303

#제출 시각아이디문제언어결과실행 시간메모리
1090303Alihan_8Gap (APIO16_gap)C++17
0 / 100
48 ms2852 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; using i64 = long long; pair <i64,i64> qry(i64 s, i64 t){ i64 mn, mx; MinMax(s, t, &mn, &mx); return {mn, mx}; } long long findGap(int T, int n){ auto [mn, mx] = qry(0, (i64)1e18); i64 lb = (mx - mn) / (n - 1), opt = lb; i64 pv = mn, j = mn + 1; while ( j <= mx ){ auto [l, r] = qry(j, j + lb - 1); if ( l != -1 ){ opt = max(opt, l - pv); } pv = r; j += lb; } return opt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...