This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include <iostream>
using namespace std;
typedef long long ll;
ll t, n;
long long findGap(int T, int N)
{
t = T;
n = N;
ll a, b;
MinMax(1LL, 1000000000000000000LL, &a, &b);
ll c = (b - a + n - 1) / n;
ll t1 = 1e18;
ll ans = c;
for(ll i = a; i <= b - c + 1; i += c)
{
ll t3, t4;
MinMax(i, i + c - 1, &t3, &t4);
if(t3 != -1)
{
ans = max(ans, t3 - t1);
t1 = t4;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |