# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42586 | fefe | Palembang Bridges (APIO15_bridge) | C++14 | 689 ms | 53100 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<bits/stdc++.h>
#define MAX_N 100005
#define inf (1LL<<60)
#define pb push_back
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef pair<LL,LL> pil;
struct node{
LL cnt,sum;
node *l,*r;
node(LL cnt,LL sum,node *l,node *r):cnt(cnt),sum(sum),l(l),r(r){}
}*R1,*R2;
LL n,k,m;
LL ans,aa;
vector<LL> X;
pil arr[MAX_N];
pil serch(LL idx,node *x,LL cnt,LL p){
if(idx<0 && p>=X.size()) return {0,0};
if(idx<0) return {X[p],X[p]*cnt};
if(x->l->cnt<cnt){
pil q=serch(idx-1,x->r,cnt-x->l->cnt,(p|(1LL<<idx)));
q.se+=x->l->sum;
return q;
}
return serch(idx-1,x->l,cnt,p);
}
LL read(node *RX){
pil p=serch(17,RX,RX->cnt/2,0);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |