제출 #47275

#제출 시각아이디문제언어결과실행 시간메모리
47275TalantGap (APIO16_gap)C++17
30 / 100
73 ms2280 KiB
#include <bits/stdc++.h>

#include "gap.h"
//#include "grader.cpp"

using namespace std;

const int M = (1e6 + 5);

long long ans = 0;
long long a[M];
long long l,r = 1e18;
int ll,rr;

long long findGap(int T, int N)
{
      int o = (N + 1) / 2;
      ll = 1,rr = N;
      while (o --) {
            MinMax(l,r,&a[ll],&a[rr]);
            l = a[ll] + 1,r = a[rr] - 1;
            ll ++,rr --;
      }
      for (int i = 1; i < N; i ++)
            ans = max(ans,a[i + 1] - a[i]);
      return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...