Submission #304749

#TimeUsernameProblemLanguageResultExecution timeMemory
304749rocks03Gap (APIO16_gap)C++14
0 / 100
37 ms1172 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; void MinMax(long long s, long long t, long long *mn, long long *mx); long long findGap(int T, int N){ if(T == 1){ ll l = 0, r = LLONG_MAX; ll arr[N]; for(int i = 0, j = N-1; i <= j; i++, j--){ ll *mn, *mx; MinMax(l, r, mn, mx); arr[i] = *mn, arr[j] = *mx; l = arr[i] + 1, r = arr[j] - 1; } ll ans = 0; for(int i = 1; i < N; i++){ ans = max(ans, arr[i] - arr[i-1]); } return ans; } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
gap.cpp:13:19: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |             MinMax(l, r, mn, mx);
      |             ~~~~~~^~~~~~~~~~~~~~
gap.cpp:13:19: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...