# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491070 | dung11112003 | Jousting tournament (IOI12_tournament) | C++11 | 121 ms | 12112 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;
template <class T>
struct SegTree
{
T const identity;
std::vector <T> f;
T (* const combine)(T, T);
SegTree(int n, T const identity, T (* const combine)(T, T)) : identity(identity), f(n * 4, identity), combine(combine) {}
void init(int n, T val)
{
f.assign(n * 4, val);
}
template <class H>
void build(int x, int lo, int hi, const H construct)
{
if (lo == hi)
{
f[x] = construct(lo);
return;
}
int mid = (lo + hi) / 2;
build(x * 2, lo, mid, construct);
build(x * 2 + 1, mid + 1, hi, construct);
f[x] = combine(f[x * 2], f[x * 2 + 1]);
}
void set(int x, int lo, int hi, int idx, T val)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |