Submission #440789

#TimeUsernameProblemLanguageResultExecution timeMemory
440789hibye1217Gap (APIO16_gap)C++17
30 / 100
118 ms1844 KiB
#ifndef NOTSUBMIT #include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #endif // Subtask 1 Only ll arr[100020]; ll findGap(int T, int N){ if (T == 1){ ll mn = 0, mx = 1e18; int st = 1, ed = N; while (st <= ed){ MinMax(mn, mx, &arr[st], &arr[ed]); mn = arr[st]+1; mx = arr[ed]-1; st += 1; ed -= 1; } ll ans = 0; for (int i = 1; i < N; i++){ ans = max(ans, arr[i+1] - arr[i]); } return ans; } }

Compilation message (stderr)

gap.cpp: In function 'll 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...