# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44509 | faustaadp | Gap (APIO16_gap) | C++17 | 130 ms | 2448 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll ma,u1,u2,ce,L1,R1,L2,R2,L,R;
priority_queue<pair<ll,pair<ll,ll> > >pq;
long long findGap(int T, int N)
{
ma=0;
MinMax(0,(ll)1e18,&L,&R);
pq.push(mp(R-L,mp(L,R)));
while(!pq.empty())
{
u1=pq.top().se.fi;
u2=pq.top().se.se;
pq.pop();
ce=(u1+u2)/2;
MinMax(u1,ce,&L1,&R1);
MinMax(ce+1,u2,&L2,&R2);
ma=max(ma,L2-R1);
if(R1-L1>ma)
pq.push(mp(R1-L1,mp(L1,R1)));
if(R2-L2>ma)
pq.push(mp(R2-L2,mp(L2,R2)));
}
return ma;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |