# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
362519 | flappybird | Gap (APIO16_gap) | C++14 | 56 ms | 2464 KiB |
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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 101010
#define INF 1000000000000000001
#define pb push_back
#define all(v) v.begin(), v.end()
long long findGap(int T, int N) {
if (T == 1) {
ll i;
ll l, r;
l = 0;
r = INF;
int cnt = 0;
vector<ll> arr;
while (l <= r && cnt + 1 <= ((N + 1) / 2)) {
MinMax(l, r, &l, &r);
if (l != -1) arr.pb(l);
if (r != -1) arr.pb(r);
l++;
r--;
cnt++;
}
sort(all(arr));
ll ret = 0;
for (i = 0; i < arr.size() - 1; i++) ret = max(ret, arr[i + 1] - arr[i]);
return ret;
}
else {
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |