# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
405708 | inluminas | Gap (APIO16_gap) | C++14 | 71 ms | 2328 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;
#define ll long long
#define endl "\n"
vector<ll>a;
long long findGap(int T, int N)
{
ll mn,mx;
MinMax(0,1e18,&mn,&mx);
ll len=(mx-mn-1)/(N-1);
a.push_back(mn);
for(int i=1;i<=N-1;i++){
if(mn+1==mx-1){
a.push_back(mn+1);
break;
}
if(mn+1>mx-1) break;
ll coto,boro;
MinMax(mn+1,min(mx-1,mn+len+1),&coto,&boro);
mn=mn+1+len;
if(coto==-1){
continue;
}
a.push_back(coto);
if(coto!=boro) a.push_back(boro);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |