# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754858 | TimDee | Jousting tournament (IOI12_tournament) | C++17 | 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 "tournament.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0;i<n;++i)
#define pb push_back
#define all(x) x.begin(),x.end()
#define pi pair<int,int>
#define f first
#define s second
struct sgt {
struct node {
int x=0, cant=0, lazy=0;
};
vector<node> t; int sz=1;
void push(int v) {
if (t[v].cant) {
t[2*v+1].cant=1;
t[2*v+2].cant=1;
}
if (!t[2*v+1].cant) t[2*v+1].lazy+=t[v].lazy;
if (!t[2*v+2].cant) t[2*v+2].lazy+=t[v].lazy;
t[v].x+=t[v].lazy;
t[v].lazy=0;
}
sgt(int n) {
while (sz<n) sz<<=1;
t.assign(4*sz,node());
}
void add(int v, int l, int r, int lx, int rx) {