# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1073632 | clementine | Gap (APIO16_gap) | C++17 | 34 ms | 3968 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)
{
ll l = 0;
ll r = 10e18;
vector<ll> left, right;
int calls = (N + 1) / 2;
ll mn, mx;
for(int j = 1; j <= calls; j ++)
{
MinMax(l, r, &mn, &mx);
if(mn != mx)
{
right.push_back(mx);
}
left.push_back(mn);
l = mn + 1;
r = mx - 1;
}
ll mxdif = 0;
for(int i = 0; i <((int)left.size() - 1); i ++)
{
mxdif = max(mxdif, left[i + 1] - left[i]);
}
for(int i = right.size() - 1; i >=1; i --)
{
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |