제출 #536192

#제출 시각아이디문제언어결과실행 시간메모리
536192terrasphereGap (APIO16_gap)C++17
30 / 100
58 ms1960 KiB
#include "gap.h" #include <bits/stdc++.h> long long findGap(int T, int N) { long long arr[111111]; long long mn, mx; long long high=1e18,low=1; if(T==1) { for(int i=1;i<=N/2;i++) { MinMax(low,high,&mn,&mx); arr[i]=mn; arr[N-i+1]=mx; low=mn+1; high=mx-1; } if(N%2==1) { MinMax(low,high,&mn,&mx); arr[N/2+1]=mn; } long long answer=0; for(int i=2;i<=N;i++) answer=std::max(answer,arr[i]-arr[i-1]); return answer; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...