# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96322 | jamielim | Gap (APIO16_gap) | C++14 | 83 ms | 2680 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 findGap(int T,int N){
if(T==1){
long long arr[N];
int a=0,b=N-1;
long long s=0,t=1000000000000000000;
long long mn,mx;
while(a<=b){
MinMax(s,t,&mn,&mx);
arr[a]=mn;
arr[b]=mx;
s=mn+1;
t=mx-1;
a++; b--;
}
long long ans=0;
for(int i=1;i<N;i++){
ans=max(ans,arr[i]-arr[i-1]);
}
return ans;
}else{
long long s=0,t=1000000000000000000;
long long mn,mx;
MinMax(s,t,&mn,&mx);
if(N==2)return mx-mn;
long long k=mx-mn+1;
s=mn+1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |