# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163876 | Kubalionzzale | Gap (APIO16_gap) | C++14 | 90 ms | 3952 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 <vector>
#include <algorithm>
#include <assert.h>
#include <iostream>
long long findGap(int T, int n)
{
long long int minValue = 0, maxValue = 1e18;
std::vector<long long int> vec;
if (T == 1)
{
long long int left = 0, right = 0;
do
{
MinMax(minValue, maxValue, &left, &right);
if (left != -1)
vec.push_back(left);
if (right != left)
vec.push_back(right);
minValue = left + 1;
maxValue = right - 1;
} while (minValue <= maxValue && left != -1 && right != -1);
std::sort(vec.begin(), vec.end());
long long int maxi = 0;
for (int i = 1; i < vec.size(); ++i)
{
if (vec[i] - vec[i - 1] > maxi)
maxi = vec[i] - vec[i - 1];
}
return maxi;
}
else
{
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |