# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1203255 | meligy122 | Gap (APIO16_gap) | C++20 | 33 ms | 2340 KiB |
#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll findGap(int T, int N)
{
ll ans=N;
ll l=0,r=1e18;
vector<ll>a;
while(ans>0){
ll mn=0,mx=0;
MinMax(l,r, &mn, &mx);
ans-=2;
a.push_back(mn);
a.push_back(mx);
l=mn+1;
r=mx-1;
}
ll maxx=-1;
sort(a.begin(),a.end());
for(int i=1;i<a.size();i++){
maxx=max(maxx,a[i]-a[i-1]);
}
return maxx;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |