Submission #95622

#TimeUsernameProblemLanguageResultExecution timeMemory
95622jeffGap (APIO16_gap)C++14
53.51 / 100
81 ms1272 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; long long findGap(int T, int N) { long long l, r, y, z, ls = -1, rs = 0, a, b = 0, i; MinMax(0, 1000000000000000000, &y, &z); for (i = 0; b < z; ++i) { a = y + ((z - y) / N + 2) * i; b = y + ((z - y) / N + 2) * (i + 1); if (a >= b) continue; MinMax(a, b, &l, &r); if (l < 0 && r < 0) continue; if (ls > -1) rs = max(rs, l - ls); ls = r; } return rs; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...