# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304754 | rocks03 | Gap (APIO16_gap) | C++14 | 35 ms | 1164 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>
#define ll long long
using namespace std;
void MinMax(long long s, long long t, long long *mn, long long *mx);
long long findGap(int T, int N){
if(T == 1){
ll arr[N];
ll l = 0, r = LLONG_MAX;
for(int i = 0, j = N-1; i <= j; i++, j--){
ll *mn, *mx;
MinMax(l, r, mn, mx);
arr[i] = *mn, arr[j] = *mx;
l = arr[i] + 1, r = arr[j] - 1;
}
ll ans = 0;
for(int i = 1; i < N; i++){
ans = max(ans, arr[i] - arr[i-1]);
}
return ans;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |