제출 #115444

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1154442019-06-07 13:40:01nvmdavaGap (APIO16_gap)C++17
100 / 100
73 ms1968 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long findGap(int T, int N)
{
if(T == 1){
a[0] = 0;
int r = N;
a[N + 1] = 1000000000000000006;
for(int l = 1; l <= r; l++){
MinMax(a[l - 1] + 1, a[r + 1] - 1, &a[l], &a[r]);
r--;
}
long long res = 0;
for(int l = 1; l < N; l++){
res = max(res, a[l + 1] - a[l]);
}
return res;
} else {
long long s, t;
MinMax(1, 1000000000000000000, &s, &t);
long long l, r;
l = s + 1;
long long sz = (t - s + 1) / N;
long long lf = s, res = 0;
long long a, b;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...