# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
624880 | Cyber_Wolf | Gap (APIO16_gap) | C++14 | 0 ms | 0 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.
//Contest: APIO 16 Problem 3
//Problem Name: Gap
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define lg long long
lg findGap(lg subtask, lg n)
{
vector<lg> v;
lg last = 0;
for(int i = 0; i < n; i++)
{
lg mnm, mxm;
MinMax(last, 1e18, &mnm, &mxm);
v.push_back(mnm);
last = mnm+1;
}
lg ans = 0;
for(int i = 1; i < v.size(); i++) ans = max(ans, v[i]-v[i-1]);
return ans;
}