Submission #956268

#TimeUsernameProblemLanguageResultExecution timeMemory
956268NeltGap (APIO16_gap)C++17
30 / 100
32 ms3880 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 (i <= j) { 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...