Submission #1092925

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10929252024-09-25 11:31:09Trisanu_DasRailway Trip 2 (JOI22_ho_t4)C++17
71 / 100
519 ms70872 KiB
#include <bits/stdc++.h>
using namespace std;
struct SegmentTree {
int size;
vector<pair<int, int>> seg;
const pair<int, int> ID = {0, 0};
pair<int, int> combine(pair<int, int> a, pair<int, int> b) {
if (a == ID) return b;
if (b == ID) return a;
int left = min(a.first, b.first);
int right = max(a.second, b.second);
return {left, right};
}
void init(int n, vector<pair<int, int>>& values) {
size = 1;
while (size < n) size <<= 1;
seg.assign(2 * size + 2, ID);
for (int i = 0; i < n; i++) seg[i + 1 + size] = values[i];
for (int i = size - 1; i >= 1; i--)
seg[i] = combine(seg[i << 1], seg[(i << 1) + 1]);
}
pair<int, int> query(int a, int b, int x, int l, int r) {
if (b < l || a > r) return ID;
if (a <= l && b >= r) return seg[x];
int mid = (l + r) >> 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...