제출 #213296

#제출 시각아이디문제언어결과실행 시간메모리
213296KoalaMuchGap (APIO16_gap)C++14
0 / 100
57 ms1912 KiB
#include "gap.h" //#include "grader.cpp" #include<bits/stdc++.h> using namespace std; long long a[100005]; long long findGap(int T, int N) { long long ans = 0; if(T==1) { long long l = -1,r = 1e18+1; for(int i=1;i<=(N+1)/2;i++) { long long mn,mx; MinMax(l+1,r-1,&mn,&mx); a[i] = l = mn; a[N-i+1] = r = mx; } } else { long long lst = -1; for(int i=1;i<=N;i++) { long long mn,mx; MinMax(lst+1,lst+1,&mn,&mx); // printf("%lld %lld %lld\n",lst+1,mn,mx); a[i] = lst = mn; } } for(int i=2;i<=N;i++) ans = max(ans,a[i]-a[i-1]); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...