# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
636789 | | Tob | Gap (APIO16_gap) | C++14 | | 63 ms | 5800 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 <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
long long findGap(int T, int N)
{
set <ll> s;
ll a, b, nn = 2, mx = 0, la = -1;
MinMax(0, 1e18, &a, &b);
s.insert(a);
s.insert(b);
while (nn < N) {
MinMax(a+1, b-1, &a, &b);
s.insert(a);
s.insert(b);
}
for (auto it : s) {
if (la != -1) {
mx = max(mx, it - la);
}
la = it;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |