Submission #960065

#TimeUsernameProblemLanguageResultExecution timeMemory
960065MinaRagy06Gap (APIO16_gap)C++17
59.02 / 100
42 ms3084 KiB
#include <bits/stdc++.h> #include "gap.h" #ifdef MINA #include "grader.cpp" #endif using namespace std; #define ll long long const ll inf = 1e18; ll findGap(int t, int n) { ll s, e; MinMax(0, inf, &s, &e); if (n == 2) { return e - s; } ll len = e - s; ll b = (len - 1) / (n - 1); ll lst = s, mx = 0; ll en = e; for (ll i = s; i <= en; i += b) { MinMax(i, min(i + b - 1, en), &s, &e); if (s == -1) continue; if (s != -1) { // cout << s - lst << '\n'; mx = max(mx, s - lst); } lst = e; } return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...