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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 2;
const int K = 2;
ll get_ans(vector<ll> v){
ll ret = 0;
for(int i = 0; i < (int)v.size() - 1; ++i) ret = max(ret, v[i + 1] - v[i]);
return ret;
}
ll findGap(int t, int n){
vector<ll> ans (n);
if(1){
int L = 0, R = n - 1;
ll val_l = 0, val_r = 1e18;
while(L < R){
MinMax(val_l, val_r, &val_l, &val_r);
ans[L] = val_l; ans[R] = val_r;
++L; --R;
++val_l; --val_r;
}
}
for(ll x : ans) cout << x << " ";
cout << "\n";
return get_ans(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |