# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38762 | Waschbar | Gap (APIO16_gap) | C++14 | 0 ms | 0 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"
using namespace std;
const long long INF = 1e18;
long long findGap(int T, int N) {
multiset < pair< long long,pair<long long,long long> > > st;
long long mn, mx;
MinMax(0ll,INF,&mn,&mx);
st.insert({-(mx-mn),{mn,mx}});
long long ans = 0;
if(n == 2){
return mx - mn;
}
long long mnds = (mx-mn)/(n-1);
int kk = 0;
if(mn != -1) kk++;
if(mn != mx) kk++;
while(!st.empty()) {
long long L, R;
if(abs(st.begin()->first) <= ans)
return ans;
L = st.begin()->second.first;