2018-08-01から1ヶ月間の記事一覧

遅延Segtree2

イロモノにしか見えないと思いきや案外いいのでは? #include <bits/stdc++.h> using namespace std; using uint = unsigned int; template<class T> using V = vector<T>; //template<class D, class L, auto op_dd, auto op_dl, auto op_ll> (since c++17) template<class D, class L, D (*op_dd)(D, D), L (*op_dl)(D, L), L (*op_ll)(L, L)> str…</class></class></t></class></bits/stdc++.h>

遅延SegTree

色々隠蔽の方法を考えています。 これはなんかごついね #include <bits/stdc++.h> using namespace std; using uint = unsigned int; template<class T> using V = vector<T>; template<class OP> struct SegTree { using D = typename OP::D; using L = typename OP::L; static constexpr auto e_</class></t></class></bits/stdc++.h>…

一般化(抽象化?)Segtree

#include <bits/stdc++.h> using namespace std; using uint = unsigned int; template<class T> using V = vector<T>; template<class D, class OP> struct SegTree { OP op; //f(data, data) -> data D e; //単位元 int n, sz, lg; //サイズ, 2^lgに拡張後のサイズ, lg V<D> seg; SegTree(V<D> first, OP _op, D</d></d></class></t></class></bits/stdc++.h>…