Submission #560225

#TimeUsernameProblemLanguageResultExecution timeMemory
560225Trisanu_DasGap (APIO16_gap)C++17
0 / 100
49 ms1088 KiB
#include <bits/stdc++.h> #include "gap.h" #define ll long long int using namespace std; ll findGap(int type, int n){ ll ma, mi, ans; MinMax(0, 2e18, &mi, &ma); if(type == 1){ for(int i = 1; i < (n + 1) / 2; ++i){ ll currma, currmi; MinMax(mi + 1, ma - 1, &currmi, &currma); ans = max(ans, max(currmi - mi, ma - currma)); mi = currmi; ma = currma; } return ans = max(ans, ma - mi); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
gap.cpp:7:14: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
    7 |   ll ma, mi, ans;
      |              ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...