이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// Be name khoda //
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define pb push_back
const int maxn5 = 5e2 + 5;
const int maxnb = 1e3 + 10;
const int mod = 1e9 + 7;
vector <ll> have;
long long findGap(int T, int N)
{
ll lo = 0, hi = 1e18;
int rem = N;
while(rem > 0 && hi >= lo){
ll mn, mx;
MinMax(lo, hi, &mn, &mx);
//cout << "asking for " << lo << ' ' << hi << ' ' << mn << ' ' << mx << endl;
have.pb(mn);
if(mx != mn)
have.pb(mx);
lo = mn + 1;
hi = mx - 1;
rem -= 2;
}
sort(all(have));
ll ans = 0;
for(int i = 1; i < N; i++)
ans = max(ans, have[i] - have[i - 1]);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |