Submission #1260173

#TimeUsernameProblemLanguageResultExecution timeMemory
1260173Szymon_PilipczukGap (APIO16_gap)C++20
70 / 100
40 ms1096 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define st first #define nd second #define pb push_back #define all(a) a.begin(),a.end() #define rep(a,b) for(int a = 0;a<b;a++) const int inf = 1e9; const ll infl = 1e18; ll findGap(int t,int n) { if(t == 2) { ll ans = 0; ll a,b; MinMax(0LL,infl,&a,&b); ll minans = (b-a + n-2)/(n-1); ll prev = a; for(ll i = a+1;i<b;i += minans+1) { ll c,d; MinMax(i,min(i+minans,b-1),&c,&d); if(c == -1) continue; ans = max(ans,c-prev); prev = d; } ans = max(ans,b-prev); return ans; } }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...