| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 109775 | boatinw99 | Gap (APIO16_gap) | C++11 | 66 ms | 3956 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 "gap.h"
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const ll inf = 1e18 ;
vector<ll> v ;
ll findGap(int T, int N)
{
ll mn,mx,l=1,r=inf ;
if(T==1)
{
while(l<r)
{
MinMax(l,r,&mn,&mx);
v.emplace_back(mn);
v.emplace_back(mx);
l=mn+1,r=mx-1;
}
}
else
{
MinMax(l,r,&mn,&mx);
l=mn,r=mx;
v.emplace_back(mn),v.emplace_back(mx);
ll len = (mx-mn)/(N-2);
for(ll i=mn+1;i<mx;i+=len)
{
MinMax(i,i+len,&mn,&mx);
v.emplace_back(mn),v.emplace_back(mx);
}
}
sort(v.begin(),v.end());
ll ret = 0 ;
for(int i=1;i<v.size();i++)ret=max(ret,v[i]-v[i-1]);
return ret ;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
