# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
743500 | emptypringlescan | Two Currencies (JOI23_currencies) | C++17 | 1138 ms | 469160 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>
using namespace std;
struct node{
long long val,cnt;
node *l, *r;
node(long long V, long long C){
val=V;
cnt=C;
l=r=NULL;
}
node(node* le, node* ri){
l=le;
r=ri;
val=l->val+r->val;
cnt=l->cnt+r->cnt;
}
};
void prop(node* nd){
if(nd->l==NULL){
nd->r=new node(0LL,0LL);
nd->l=new node(0LL,0LL);
}
}
node* update(node* lol, int s, int e, int x){
if(s==e) return new node(lol->val+s,lol->cnt+1);
int mid=(s+e)/2;
prop(lol);
if(x<=mid) return new node(update(lol->l,s,mid,x),lol->r);
else return new node(lol->l,update(lol->r,mid+1,e,x));
# | 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... |