# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
286049 | emanIaicepsa | Holiday (IOI14_holiday) | C++14 | 1469 ms | 36916 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"holiday.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define fi first
#define se second
#define pii pair<ll,ll>
#define all(n) (n).begin(),(n).end()
#define pb push_back
#define dbg(x) cerr<<#x<<" = "<<x<<'\n';
struct Persistent_tree{
ll l, r;
ll tot, cnt;
}tr[8000005];
ll idx = 0, rt[100005];
void insert(ll copy, ll &now, ll val, ll L, ll R){
now = ++idx;
if(copy) tr[now] = tr[copy];
tr[now].cnt++;
tr[now].tot += val;
if(L == R){
/* cout<<now<<'\n'; */
return;
}
ll M = (L+R)/2;
if(val <= M) insert(tr[copy].l, tr[now].l, val, L, M);
else insert(tr[copy].r, tr[now].r, val, M+1, R);
# | 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... |