Submission #557913

#TimeUsernameProblemLanguageResultExecution timeMemory
557913Ai7081Gap (APIO16_gap)C++17
0 / 100
28 ms1116 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define ll long long const ll inf = 1e18; long long findGap(int T, int N) { ll *allmin, *allmax; MinMax((ll)1, inf, allmin, allmax); ll gap = (allmin - allmax + N-2) / (N-1); ll now = *allmin+1, last = *allmin, ans=0; // printf("allmin %lld allmax %lld\n", *allmin, *allmax); while (now < *allmax) { ll *mi, *ma; // printf("now %lld\n", now); MinMax(now, min(inf, now+gap), mi, ma); if (*mi != -1) ans = max(ans, *mi - last); if (*ma != -1) last = *ma; now = now+gap+1; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:11: warning: 'allmin' is used uninitialized in this function [-Wuninitialized]
   11 |     MinMax((ll)1, inf, allmin, allmax);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
gap.cpp:11:11: warning: 'allmax' is used uninitialized in this function [-Wuninitialized]
gap.cpp:18:15: warning: 'mi' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |         MinMax(now, min(inf, now+gap), mi, ma);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gap.cpp:18:15: warning: 'ma' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...