# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
400554 | A_D | Gap (APIO16_gap) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
#define ii pair<int,int>
#define F first
#define S second
#define du long double
#define ll long long
using namespace std;
vector<ll> vec;
long long findGap(int T, int N)
{
ll l=1,r=1e18;
ll l2=1,r2=1e18;
ll&l1=l2;
ll&rl=r2;
while(l<r){
MinMax(l,r,l1,r1);
vec.push_back(l2);
vec.push_back(r2);
l=l2;
r=r2;
}
sort(vec.begin(),vec.end());
ll ans=0;
for(ll i=1;i<vec.size();i++)ans=max(ans,vec[i]-vec[i-1]);
return ans;
}