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