# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1027515 | KasymK | Gap (APIO16_gap) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "gap.h"
using namespace std;
#define pb push_back
#define all(v) v.begin(), v.end()
#define ll long long
const int N = 1e5+5;
ll a[N];
ll findGap(int t, int n){
if(t == 1){
ll l = 1, r = 1e18, id = 0, mn, mx, answer = 0;
for(int i = 0; i < (n+1)/2; ++i){
MinMax(l, r, &mn, &mx);
a[id++] = mn;
a[id++] = mx;
l = mn+1, r = mx-1;
}
sort(a, a+n);
for(int i = 0; i < n-1; ++i)
answer = max(answer, a[i+1]-a[i]);
return answer;
}
return answer;
}