#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define INF 1000000019
#define POT (1<<20)
#define INFL 1000000000000000099LL
ll findGap(int T,int n){
ll pocz,kon;
MinMax(0,1000000000000000000,&pocz,&kon);
ll bst=(kon-pocz+n-2)/(n-1);
vector<ll>v1={pocz},v2={kon};
while(pocz!=kon){
ll a,b;
//cout<<bst<<" ";
MinMax(pocz+1,kon-1,&a,&b);
v1.pb(a);
v2.pb(b);
pocz=a;
kon=b;
}
while(v2.size()){
v1.pb(v2.back());
v2.pop_back();
}
for(ll i=1;i<n;i++)bst=max(bst,v1[i]-v1[i-1]);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |