# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
367729 | abra_stone | Gap (APIO16_gap) | C++14 | 59 ms | 2468 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>
using namespace std;
typedef long long ll;
ll ans;
vector<ll> a;
ll findGap(int T, int n) {
ll i, mn = 0, mx = 2e18;
for (i = 0; i < n; i += 2) {
MinMax(mn, mx, &mn, &mx);
a.push_back(mn);
a.push_back(mx);
mn++;
mx--;
}
sort(a.begin(), a.end());
for (i = 1; i < a.size(); i++) {
ans = max(ans, a[i] - a[i - 1]);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |