Submission #574622

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5746222022-06-09 01:00:56JovanBRailway Trip 2 (JOI22_ho_t4)C++17
100 / 100
724 ms73904 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 200000;
const int LOG = 19;
int L[LOG+1][N+5], R[LOG+1][N+5];
struct Segment{
int lv[4*N+5], rv[4*N+5];
void init(int node, int l, int r, int t){
if(l == r){
lv[node] = L[t][l];
rv[node] = R[t][l];
return;
}
int mid = (l+r)/2;
init(node*2, l, mid, t);
init(node*2+1, mid+1, r, t);
lv[node] = min(lv[node*2], lv[node*2+1]);
rv[node] = max(rv[node*2], rv[node*2+1]);
}
pair <int, int> query(int node, int l, int r, int tl, int tr){
if(tl > r || l > tr) return {N + 5, 0};
if(tl <= l && r <= tr) return {lv[node], rv[node]};
int mid = (l+r)/2;
pair <int, int> a = query(node*2, l, mid, tl, tr);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...