# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162064 | impri | Gap (APIO16_gap) | C++14 | 61 ms | 3792 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<bits/stdc++.h>
#include"gap.h"
using namespace std;
long long res[100001];
long long findGap(int T,int N){
long long mi,ma;
long long *mn=&mi;
long long *mx=&ma;
MinMax(1,10e18,mn,mx);
res[1]=mi;
res[N]=ma;
int curmi=2;
int curma=N-1;
while(1){
if(curmi>curma)break;
MinMax(res[curmi-1]+1,res[curma+1]-1,mn,mx);
res[curmi]=mi;
res[curma]=ma;
curmi++;
curma--;
}
long long r=10e18;
for(int i=1;i<N-1;i++){
r=min(r,res[i+1]-res[i]);
}
return r;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |