Submission #560226

#TimeUsernameProblemLanguageResultExecution timeMemory
560226Trisanu_DasGap (APIO16_gap)C++17
30 / 100
48 ms1100 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; ll ans = 0; 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 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...