# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
282593 | AaronNaidu | Gap (APIO16_gap) | C++14 | 64 ms | 2448 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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
ll findGap(int t, int n) {
vector<ll> v;
ll leftPointer = 0;
ll rightPointer = 1000000000000000000;
ll mn = 0;
ll mx = 0;
while (v.size() < n)
{
MinMax(leftPointer, rightPointer, &mn, &mx);
v.push_back(mn);
v.push_back(mx);
leftPointer = mn+1;
rightPointer = mx-1;
}
sort(v.begin(), v.end());
ll maxDiff = 0;
for (int i = 1; i < v.size(); i++)
{
maxDiff = max(maxDiff, v[i]-v[i+1]);
}
return maxDiff;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |