Submission #464724

#TimeUsernameProblemLanguageResultExecution timeMemory
464724nickmet2004Gap (APIO16_gap)C++11
30 / 100
46 ms1172 KiB
#include<bits/stdc++.h> #include "gap.h" #define ll long long using namespace std; ll findGap(int T , int n){ ll ans = 0; ll x = 0 , y = 1e18 ,mn , mx; if(T == 1){ MinMax(x , y , &mn , &mx); x = mn , y = mx; for(int i = 1; i < (n + 1) /2; ++i){ MinMax(x+1 , y-1 , &mn , &mx); ans = max({ans, y - mx , mn - x}); x = mn , y =mx; } } return max(ans , mx-mn); //1 2 3 4 5 6 }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:18:24: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |     return max(ans , mx-mn);
      |                      ~~^~~
gap.cpp:18:24: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...