이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
#define int long long
using namespace std;
#ifdef DEBUGGING
#include "../debug.h"
#else
#define debug(x...) void(42)
#endif
int subtask1(int n)
{
vector<int> v(n);
int l, r;
MinMax(0, 1e18, &l, &r);
v[0] = l;
v[n-1] = r;
int ll = 1, rr = n-2;
l++;
r--;
while (rr>=ll)
{
debug(l, r);
int a, b;
MinMax(l, r, &a, &b);
if (a == -1)
break;
debug(a, l, b, r);
debug(a, b, ll, rr);
v[ll++] = a;
v[rr--] = b;
l++, r--;
}
debug(v);
int res = 0;
for (int i = 0; i < n-1; i++)
res = max(res, v[i+1] - v[i]);
return res;
}
int findGap(int32_t t, int32_t n)
{
return subtask1(n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |