Submission #295597

#TimeUsernameProblemLanguageResultExecution timeMemory
295597arayiGap (APIO16_gap)C++17
0 / 100
64 ms1272 KiB
#include <bits/stdc++.h> #include "gap.h" #define lli long long int using namespace std; int n; long long findGap(int T, int N) { n = N; lli nl, nr; MinMax(0, 1e18, &nl, &nr); lli ans = 1; while(nl < nr) { lli l, r; MinMax(nl + 1, nl + ans * 2 - 1, &l, &r); if(l == -1) ans = ans * 2LL; else ans = max(ans, l - nl), nl = r; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...