이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <vector>
#include <iostream>
using namespace std;
typedef long long ll;
vector<int> a;
long long findGap(int t, int n)
{
a.resize(n);
ll x = 0, y = (ll)(1e18);
int d = 0, f = n-1;
while (d <= f) {
MinMax(x, y, &x, &y);
a[d] = x;
a[f] = y;
++x; ++d;
--y; --f;
}
int r = 0;
for (int i = 0; i < (n-1); ++i) {
r = max(r, a[i+1] - a[i]);
}
return r;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |