# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
245754 | gs18115 | Holiday (IOI14_holiday) | C++14 | 0 ms | 0 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<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18+7;
struct node
{
int cnt;
ll sum;
int l,r;
node(){sum=0;cnt=l=r=0;}
}tree[1800010];
int tct;
void upd(int&n,int s,int e,int x,int p)
{
tree[++tct]=tree[n];
n=tct;
tree[n].cnt++;
tree[n].sum+=p;
if(s==e)
return;