# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
246009 | wwdd | Gap (APIO16_gap) | C++14 | 76 ms | 3364 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 <stdio.h>
#include <stdlib.h>
#include "gap.h"
#include <vector>
using ll = long long;
using vl = std::vector<ll>;
using namespace std;
ll lol(ll n) {
vl wa,wb;
ll lo = 0,hi = 1e18;
ll ok = (n+1)/2;
for(int i=0;i<ok;i++) {
ll ma,mi;
MinMax(lo,hi,&mi,&ma);
lo = mi+1;hi = ma-1;
wa.push_back(mi);
wb.push_back(ma);
}
if(n&1) {wa.pop_back();}
for(int i=wb.size()-1;i>=0;i--) {wa.push_back(wb[i]);}
ll res = 0;
for(int i=1;i<n;i++) {
res = max(res,wa[i]-wa[i-1]);
}
return res;
}
ll solve(ll n) {
ll lo = 0,hi = 1e18;
ll st,ed;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |