# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
554164 | QwertyPi | Gap (APIO16_gap) | C++14 | 95 ms | 5744 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
long long findGap(int T, int N)
{
ll L, R;
MinMax(0, 1e18, &L, &R);
ll tg = 1 + (R - L - 1) / (N - 1);
set<ll> a; a.insert(L); a.insert(R);
for(ll i = L + 1; i < R; i += tg){
ll ll, rr;
MinMax(i, min(R - 1, i + tg - 1), &ll, &rr);
if(ll != -1) a.insert(ll); if(rr != -1) a.insert(rr);
}
ll ans = 0;
for(auto it = a.begin(); it != a.end(); it++){
if(next(it) != a.begin()) ans = max(ans, *next(it) - *it);
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |