제출 #1198298

#제출 시각아이디문제언어결과실행 시간메모리
1198298elotelo966Gap (APIO16_gap)C++20
0 / 100
15 ms1864 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; //#define int long long #define OYY LLONG_MAX #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define fi first #define se second #define FOR for(int i=1;i<=n;i++) #define mid (start+end)/2 #define pb push_back #define lim 200005 typedef long long lo; //~ inline void MinMax(lo xx,lo yy,lo &x,lo &y){ //~ cout<<xx<<" "<<yy<<endl; //~ lo a,b;cin>>a>>b; //~ x=a,y=b; //~ } long long findGap(int T, int N){ int r=N; lo cur_l=0,cur_r=OYY; lo dizi[N+1]; for(int l=1;l<=N;l++){ lo mn,mx; MinMax(cur_l,cur_r,&mn,&mx); if(l>r)break; dizi[l++]=mn; dizi[r--]=mx; cur_l=mn; cur_r=mx; } lo cev=0; for(int i=2;i<=N;i++){ cev=max(cev,dizi[i]-dizi[i-1]); } return cev; } //~ int main(){ //~ faster //~ int t,n;cin>>t>>n; //~ cout<<findGap(t,n)<<'\n'; //~ return 0; //~ }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...