이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |