# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
407405 | Blobo2_Blobo2 | Gap (APIO16_gap) | C++14 | 75 ms | 1972 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 "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int T, int N){
long long ans=0;
long long arr[N],idx=0,mx,mn,l=0,r=1e18;
for(int i=0;i<N/2+(N%2);i++){
MinMax(l,r,&mn,&mx);
arr[i]=mn;
arr[N-i-1]=mx;
l=mn+1;
r=mx-1;
}
for(int i=0;i<N-1;i++){
cout<<arr[i]<<' ';
ans=max(ans,arr[i+1]-arr[i]);
}
cout<<arr[N-1]<<endl;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |