test/aoj/dsl/ruq.test.cpp
✅
AC
· 最終更新 2026-10-23
· GitHub
問題: https://onlinejudge.u-aizu.ac.jp/problems/DSL_2_D
依存するヘッダ(2)
-
✅
双対セグメント木
lib/segtree/dual_segment_tree.hpp
-
✅
モノイドの要件
lib/segtree/monoid.hpp
実装
// competitive-verifier: PROBLEM https://onlinejudge.u-aizu.ac.jp/problems/DSL_2_D
#include <iostream>
#include <limits>
#include "segtree/dual_segment_tree.hpp"
int main(void) {
int n, q;
std::cin >> n >> q;
DualSegmentTree<Update<int>> st(n, std::numeric_limits<int>::max());
while (q--) {
int com;
std::cin >> com;
if (com == 0) {
int s, t, x;
std::cin >> s >> t >> x;
st.apply(s, t + 1, x);
} else {
int x;
std::cin >> x;
std::cout << st.get(x) << '\n';
}
}
return 0;
}