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