# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
109433 | Plurm | Gap (APIO16_gap) | C++11 | 134 ms | 8640 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;
long long findGap(int T, int N)
{
if(T == 1){
long long lo = 0ll;
long long hi = 1e18;
long long mn, mx;
set<long long> s;
do{
MinMax(lo, hi, &mn, &mx);
if(mn == -1) break;
s.insert(mn);
s.insert(mx);
lo = mn + 1;
hi = mx - 1;
}while(lo <= hi && s.size() < N);
vector<long long> v;
for(long long x : s) v.push_back(x);
mx = 0ll;
for(int i = 1; i < N; i++){
mx = max(mx, v[i] - v[i-1]);
}
return mx;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |