Submission #956267

#TimeUsernameProblemLanguageResultExecution timeMemory
956267NeltGap (APIO16_gap)C++17
0 / 100
30 ms3808 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;

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

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:24:8: warning: unused variable 'ans' [-Wunused-variable]
   24 |     ll ans = 0;
      |        ^~~
gap.cpp:24:8: warning: control reaches end of non-void function [-Wreturn-type]
   24 |     ll ans = 0;
      |        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...