이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"gap.h"
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll find_gap1(int n){
vector<ll>vec1,vec2;
ll l=0,r=1e18;
while(true){
MinMax(l,r,&l,&r);
if(l==r){
if(l!=-1)
vec1.push_back(l);
break;
}
vec1.push_back(l);
vec2.push_back(r);
l++;
r--;
}
reverse(vec2.begin(),vec2.end());
vec1.insert(vec1.end(),vec2.begin(),vec2.end());
ll res=1e18;
for(int i=1;i<n;i++)
res=min(res,vec1[i]-vec1[i-1]);
return res;
}
ll find_gap2(int n){
return 0;
}
ll findGap(int t,int n){
if(t==1){
return find_gap1(n);
}else{
return find_gap2(n);
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |