Submission #800243

#TimeUsernameProblemLanguageResultExecution timeMemory
800243pavementGap (APIO16_gap)C++17
70 / 100
48 ms3264 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define pb push_back using ll = long long; ll findGap(int T, int N) { ll x, y; MinMax(0, (ll)1e18, &x, &y); ll k = (y - x + N - 2) / (N - 1), ans = 0; vector<ll> seq; seq.pb(x); for (ll p = x; p < y; p += k) { ll x2, y2; MinMax(p + 1, p + k, &x2, &y2); if (x2 != -1) { seq.pb(x2); seq.pb(y2); } } seq.pb(y); for (int i = 1; i < (int)seq.size(); i++) { ans = max(ans, seq[i] - seq[i - 1]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...