제출 #1352890

#제출 시각아이디문제언어결과실행 시간메모리
1352890bozhoGap (APIO16_gap)C++20
30 / 100
22 ms1976 KiB
#include <bits/stdc++.h>
#include "gap.h"
#define endl '\n'
using namespace std;

const int MAX = (2e5) + 5;

long long a[MAX];

long long findGap(int t, int n)
{
    if (t == 1)
    {
        long long l = 0, r = (1e18) + 1, s, t;
        for (int i = 1; i <= (n + 1) / 2; i++)
        {
            MinMax(l, r, &s, &t);
            a[i] = s;
            a[n - i + 1] = t;
            l = s + 1;
            r = t - 1;
        }
        long long ans = 0;
        for (int i = 2; i <= n; i++)
            ans = max(ans, a[i] - a[i - 1]);
        return ans;
    }
}

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

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