제출 #876451

#제출 시각아이디문제언어결과실행 시간메모리
876451AlphaMale06Gap (APIO16_gap)C++14
30 / 100
31 ms3792 KiB
#include<bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll=long long;

long long findGap(int subt, int n){
    if(subt==1){
        ll mn=0;
        ll mx=1e18;
        ll a[n];
        for(int i=0; i< (n+1)/2; i++){
            MinMax(mn, mx, &mn, &mx);
            a[i]=mn;
            a[n-i-1]=mx;
            mn++;
            mx--;
        }
        ll ans=0;
        for(int i=1; i<n; i++){
            ans=max(ans, a[i]-a[i-1]);
        }
        return ans;
    }
    else{

    }
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...