#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "gap.h"
#define bitcount __builtin_popcount
#define all(a) a.begin(), a.end()
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
long long findGap(int t, int n) {
long long l = -1, r = 1e18+1, mn, mx;
vector<long long> a;
while (l <= r) {
MinMax(l, r, &mn, &mx);
a.push_back(mn);
a.push_back(mx);
l = mn + 1;
r = mx - 1;
}
sort(all(a));
long long ans = 0;
for (int i = 0; i+1 < a.size(); i++)
ans = max(ans, a[i+1] - a[i]);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |