# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
401964 | Maqsut_03 | Gap (APIO16_gap) | C++14 | 64 ms | 1864 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
long long findGap(int T, int N)
{
if(T == 1)
{
vector<long long> a;
a.reserve(N);
long long s = 0, e = 1e18;
while(int(a.size()) < N)
{
MinMax(s, e, &s, &e);
assert(s != -1);
a.push_back(s); a.push_back(e);
++s;
--e;
}
sort(a.begin(), a.end());
long long ans = 0;
for(int i = 0; i < int(a.size()) - 1; ++i)
ans = max(ans, a[i + 1] - a[i]);
return ans;
}
long long a1 = 0, aN = 0;
MinMax(0, (long long)1e18, &a1, &aN);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |