# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
138351 | MoNsTeR_CuBe | Teams (IOI15_teams) | 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 "seats.h"
#include <bits/stdc++.h>
using namespace std;
struct node{
node *l, *r;
pair<int, int> mini;
pair<int, int> maxi;
void update(){
mini.first = min(l->mini.first, r->mini.first);
mini.second = min(l->mini.second, r->mini.second);
maxi.first = max(l->maxi.first, r->maxi.first);
maxi.second = max(l->maxi.second, r->maxi.second);
}
};
vector< pair<int, int> > v;
void Build(node* root, int left, int right){
if(left == right){
root->maxi.second = root->mini.second = v[left-1].second;
root->maxi.first = root->mini.first = v[left-1].first;
return;
}
int mid = (left+right)/2;
if(!root->l) root->l = new node{NULL,NULL,{0,0},{0,0}};