Submission #853503

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8535032023-09-24 13:02:54esomerEvent Hopping (BOI22_events)C++17
100 / 100
491 ms47156 KiB
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
struct segTree{
vector<pair<int, int>> mn;
int sz;
void init(int n){
sz = 1;
while(sz < n) sz *= 2;
mn.assign(2 * sz, {2e9, 2e9});
}
void set(int i, pair<int, int> val, int x, int lx, int rx){
if(rx - lx == 1){
mn[x] = val;
return;
}
int m = (lx + rx) / 2;
if(i < m) set(i, val, 2 * x + 1, lx, m);
else set(i, val, 2 * x + 2, m, rx);
mn[x] = min(mn[2 * x + 1], mn[2 * x + 2]);
}
void set(int i, pair<int, int> val){
set(i, val, 0, 0, sz);
}
pair<int, int> calc(int l, int r, int x, int lx, int rx){
if(lx >= l && rx <= r) return mn[x];
else if(lx >= r || rx <= l) return {2e9, 2e9};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...