# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601962 | idiot123 | Seats (IOI18_seats) | C++14 | 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;
const int INF = 1e9;
int n;
vector<pair<int, int>> v;
class InfoTree{
private:
int lrSize = 2;
vector<int> minR;
vector<int> maxR;
vector<int> minC;
vector<int> maxC;
void update(int pos, bool up){
minR[pos] = min(minR[2*pos], minR[2*pos+1]);
maxR[pos] = max(maxR[2*pos], maxR[2*pos + 1]);
minC[pos] = min(minC[2*pos], minC[2*pos + 1]);
maxC[pos] = max(maxC[2*pos], maxC[2*pos + 1]);
if(up && pos > 1)update(pos/2, true);
}
//minR, maxR, minC, maxC
array<int, 4> rangeInfo(int a, int b, int l, int r, int pos){
if(b < l || r < a)return {INF, -INF, INF, -INF};
if(a <= l && r <= b){