| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1325168 | riafhasan2010 | Gap (APIO16_gap) | C++17 | 34 ms | 2344 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long findGap(int t, int n) {
if (t == 1) {
ll mn = -1, mx = 1e18 + 1, ans = 0;
vector<ll> a;
for (int i = 1; i <= (n + 1) / 2; i++) {
MinMax(mn + 1, mx - 1, &mn, &mx);
if (mn < 0 or mx < 0) break;
a.push_back(mn);
a.push_back(mx);
}
sort(a.begin(), a.end());
int len = a.size();
for (int i = 1; i < len; 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... | ||||
