# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
598335 | | 8e7 | Gap (APIO16_gap) | C++17 | | 49 ms | 2228 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.
//Challenge: Accepted
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 50005
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
ll findGap(int T, int N) {
ll ret = 0;
if (T == 1) {
vector<ll> a;
ll low = 0, up = 1e18, vl, vr;
while (low < up) {
MinMax(low, up, &vl, &vr);
a.push_back(vl);
a.push_back(vr);
low = vl+1, up = vr-1;
}
sort(a.begin(), a.end());
a.resize(int(unique(a.begin(), a.end()) - a.begin()));
for (int i = 1;i < N;i++) ret = max(ret, a[i] - a[i-1]);
} else {
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |