# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111746 | PagodePaiva | 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<bits/stdc++.h>
using namespace std;
const long long MAXN = 5010;
struct Segtremax{
pair <long long, long long> tree[4*MAXN]; long long lazy[4*MAXN];
pair <long long, long long> join(pair <long long, long long> a, pair <long long, long long> b){
if(a.first < b.first) return b;
return a;
}
void unlazy(long long node, long long l, long long r){
if(lazy[node] == -1) return;
tree[node].first = lazy[node];
if(l != r){
lazy[2*node] = max(lazy[2*node], lazy[node]);
lazy[2*node+1] = max(lazy[2*node+1], lazy[node]);
}
lazy[node] = -1;
}
void build(long long node, long long l, long long r){
lazy[node] = -1;
if(l == r){
tree[node] = {0, l};
return;
}
long long mid = (l+r)/2;
build(2*node, l, mid);
build(2*node+1,mid+1, r);