제출 #40153

#제출 시각아이디문제언어결과실행 시간메모리
40153SpaimaCarpatilorGap (APIO16_gap)C++14
30 / 100
75 ms5924 KiB
#include "gap.h"
#include<bits/stdc++.h>

using namespace std;

long long x[100009];
const long long xmax = 1e18;

long long findGap(int T, int N)
{
    long long a = 0, b = xmax;
    for (int i = 1, j = N; i<=j; i ++, j --)
        MinMax (a, b, &x[i], &x[j]), a = x[i] + 1, b = x[j] - 1;
    long long ans = x[2] - x[1];
    for (int i=1; i<N; i++)
        if (x[i + 1] - x[i] > ans)
            ans = x[i + 1] - x[i];
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...