#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll findGap(int T, int N) {
if (T == 1) {
vector <ll> A, B;
ll l = 0, r = 1e18;
while (l <= r) {
ll x, y; MinMax(l, r, &x, &y);
if (x == -1) break;
A.emplace_back(x);
if (x < y) B.emplace_back(y);
l = x + 1, r = y - 1;
}
for (int i = B.size() - 1; i > -1; i--)
A.emplace_back(B[i]);
ll ans = 0;
for (int i = 1; i < A.size(); i++)
ans = max(ans, A[i] - A[i - 1]);
return ans;
}
else {
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
30 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |