Submission #668302

#TimeUsernameProblemLanguageResultExecution timeMemory
668302danikoynovGap (APIO16_gap)C++14
30 / 100
63 ms5784 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; long long findGap(int T, int N) { ll inf = 1e18; ll lf = 0, rf = 1e18, mn, mx; MinMax(0, inf, &mn, &mx); set < ll > st; st.insert(mn); st.insert(mx); int nn = 2; while(nn < N) { ll lf = mn + 1; ll rf = mx - 1; MinMax(lf, rf, &mn, &mx); st.insert(mn); st.insert(mx); nn += 2; } ll ans = 0; ll last = -1; for (auto it : st) { if (last != -1) ans = max(ans, it - last); last = it; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:10:8: warning: unused variable 'lf' [-Wunused-variable]
   10 |     ll lf = 0, rf = 1e18, mn, mx;
      |        ^~
gap.cpp:10:16: warning: unused variable 'rf' [-Wunused-variable]
   10 |     ll lf = 0, rf = 1e18, mn, mx;
      |                ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...