# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568647 | Deepesson | Gap (APIO16_gap) | C++17 | 3099 ms | 8432 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"
void MinMax(long long, long long, long long*, long long*);
using ll = long long;
long long findGap(int T, int N)
{
if(T==2)
return 0;
else {
std::map<ll,bool> mapa;
ll l=-1,r=1e18+1;
while(l+1<r-1){
ll a,b;
MinMax(l+1,r-1,&a,&b);
if(a!=-1){
mapa[a]=true;
l=a;
}
if(b!=-1){
mapa[b]=true;
r=b;
}
}
ll max=0;
std::vector<ll> vec;
for(auto&x:mapa)vec.push_back(x.first);
for(int i=1;i!=vec.size();++i)max=std::max(max,vec[i]-vec[i-1]);
return max;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |