제출 #1160427

#제출 시각아이디문제언어결과실행 시간메모리
1160427Kalata_56Gap (APIO16_gap)C++20
30 / 100
30 ms1976 KiB
#include "gap.h"
//#include<bits/stdc++.h>;
long long mas[100011];
long long findGap(int T,int N){
    long long maxa=1e18+1;
    long long ans=0;
    long long l=0,r=1e18;
    long long L=0,R=N-1;
    while(L<=R){
        //long long k1,k2;
        MinMax(l,r,&mas[L],&mas[R]);
        L++;
        R--;
        l=mas[L-1]+1;
        r=mas[R+1]-1;
    }
    for(int i=0;i<N-1;i++){
        if(mas[i+1]-mas[i]>ans){
            ans=mas[i+1]-mas[i];
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...