| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365588 | OmarAlimammadzade | Gap (APIO16_gap) | C++20 | 28 ms | 3360 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
int findGap(int32_t tc, int32_t n) {
int s = 0, t = 1e18;
int mn, mx;
MinMax(s, t, &mn, &mx);
vector<int> v;
int part = (mx - mn + n - 2) / (n - 1);
for (int i = mn; i <= mx; i += part + 1) {
int a, b;
MinMax(i, i + part, &a, &b);
if (a != -1) {
v.push_back(a);
v.push_back(b);
}
}
int ans = part;
for (int i = 1; i < v.size(); i++) {
ans = max(ans, v[i] - v[i - 1]);
}
return ans;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
