# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
668351 | danikoynov | Gap (APIO16_gap) | C++14 | 67 ms | 5788 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
long long findGap(int T, int N)
{
if (T == 1)
{
ll lf = 0, rf = 1e18, mn, mx;
set < ll > st;
int nn = 0;
while(nn < N)
{
MinMax(lf, rf, &mn, &mx);
st.insert(mn);
st.insert(mx);
lf = mn + 1;
rf = mx - 1;
nn += 2;
}
ll ans = 0;
ll last = -1;
for (auto it : st)
{
if (last != -1)
ans = max(ans, it - last);
last = it;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |