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 "gap.h"
#include <set>
#define NUM_MAX 1000000000000000000
#define max2(x,y) (x>y?x:y)
using namespace std;
int n;
set<long long> S;
long long f1() {
long long l = 0, r = NUM_MAX;
long long t1, t2, res = 0;
while (l <= r) {
MinMax(l, r, &t1, &t2);
if (t1 < 0) break;
S.insert(l = t1), S.insert(r = t2);
l++, r--;
if (S.size() == n) break;
}
t1 = NUM_MAX;
for (auto i : S) res = max2(res, i - t1), t1 = i;
return res;
}
long long findGap(int T, int _n) {
n = _n;
if (T == 1) return f1();
else;
}
Compilation message (stderr)
gap.cpp: In function 'long long int f1()':
gap.cpp:20:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (S.size() == n) break;
^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31: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... |