| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1205289 | Aviansh | Gap (APIO16_gap) | C++20 | 30 ms | 1940 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int t, int n)
{
//MinMax(s,t,mn,mx)
long long arr[n];
int l = 0;
int r = n-1;
arr[0]=0;
arr[n-1]=1e18;
while(l<r){
long long mn,mx;
MinMax(arr[l]+1,arr[r]-1,&mn,&mx);
arr[l]=mn;
arr[r]=mx;
l++;r--;
if(l<r){
arr[l]=mn;
arr[r]=mx;
}
}
long long ans = 0;
for(int i = 1;i<n;i++){
ans=max(ans,arr[i]-arr[i-1]);
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
