Submission #491070

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4910702021-11-30 11:26:54dung11112003Jousting tournament (IOI12_tournament)C++11
100 / 100
121 ms12112 KiB
#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)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...