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 <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <fstream>
#include <queue>
#include "gap.h"
using namespace std;
long long findGap(int t, int n) {
if (t != 3) {
return 0;
}
long long max = 1e18 + 5;
long long pre = 0;
long long ans = 0;
for (int i = 0; i < n; i++) {
long long mn, mx;
MinMax(0, max, &mn, &mx);
if (i == 0) {
pre = mx;
max = mx - 1;
}
else {
if (pre - mx > ans) {
ans = pre - mx;
}
pre = mx;
max = mx - 1;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |