Submission #921868

#TimeUsernameProblemLanguageResultExecution timeMemory
921868lamterGap (APIO16_gap)C++17
0 / 100
19 ms5584 KiB
#include "gap.h" #include <bits/stdc++.h> const long long iii = 1E18; void MyMinMax(long long x, long long y, long long& min, long long& max) { long long* min_place_holder; long long* max_place_holder; MinMax(x, y, min_place_holder, max_place_holder); min = *min_place_holder; max = *max_place_holder; } long long findGap(int T, int n) { if (T == 1) { std::vector <long long> a(n); MyMinMax(0, iii, a[0], a[n - 1]); for (int l = 1, r = n - 2; l <= r; l += 1, r -= 1) { MyMinMax(a[l - 1] + 1, a[r + 1] - 1, a[l], a[r]); } long long int ans = iii; for (int i = 0; i + 1 < n; i += 1) ans = std::min(ans, a[i + 1] - a[i]); return ans; } assert(0); }

Compilation message (stderr)

gap.cpp: In function 'void MyMinMax(long long int, long long int, long long int&, long long int&)':
gap.cpp:10:8: warning: 'min_place_holder' is used uninitialized in this function [-Wuninitialized]
   10 |  MinMax(x, y, min_place_holder, max_place_holder);
      |  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gap.cpp:10:8: warning: 'max_place_holder' is used uninitialized in this function [-Wuninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...