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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
long long findGap(int T, int N) {
if (T == 1) {
vector <long long> vals;
long long st = 0, dr = (long long) 1e18;
while (st <= dr) {
long long a = -1, b = -1;
MinMax(st, dr, &a, &b);
vals.push_back(a);
if (a < b)
vals.push_back(b);
if (a == -1 || b == -1)
break;
st = a + 1;
dr = b - 1;
}
sort(vals.begin(), vals.end());
long long ans = 0;
for (int i = 0; i + 1 < (int) vals.size(); i++)
ans = max(ans, vals[i + 1] - vals[i]);
return ans;
} else {
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |