Submission #900422

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9004222024-01-08 09:34:45Turkhuu운세 보기 2 (JOI14_fortune_telling2)C++17
100 / 100
264 ms27704 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
struct segtree {
int n;
T e;
T (*f)(T, T);
vector<T> s;
segtree(int n, T (*f)(T, T), T e):
n(n), e(e), f(f), s(2 * n, e) {
}
segtree(const vector<T> &a, T (*f)(T, T), T e):
segtree(a.size(), f, e) {
for (int i = 2 * n - 1; i; i--) {
s[i] = i < n ? f(s[i * 2], s[i * 2 + 1]) : a[i - n];
}
}
void set(int i, const T &v) {
for (i += n, s[i] = v; i /= 2;) {
s[i] = f(s[i * 2], s[i * 2 + 1]);
}
}
T qry(int l, int r) {
T u(e), v(e);
for (l += n, r += n; l < r; l /= 2, r /= 2) {
if (l & 1) u = f(u, s[l++]);
if (r & 1) v = f(s[--r], v);
}
return f(u, v);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...