随笔分类 - 模板
摘要:并查集 并查集(Java实现) - GoldArowana - 博客园 TODO:补充概念等知识 模板 class DSU { /** * initialSize : 初始化集合个数 * currentSize : 当前集合个数 * nodeFathers : 父节点 * nodeCounts :
阅读全文
摘要:矩阵及其快速幂 模板 Code template <typename T> concept is_mat = requires(T a) { a.row; }; template <typename T> concept not_mat = !is_mat<T>; template <typenam
阅读全文
摘要:modint 自动取模类模板 简单的一种 template <typename T> concept Can_bit = requires(T x) { x >>= 1; }; template <int MOD> struct modint { int val; static int norm(c
阅读全文
摘要:树链剖分 无权值树剖 Code struct tree_chain { int n, root; vector<int> fa, son, dep, top, sz; tree_chain(const vector<vector<int>> &adj, int _n, int _root) : n(
阅读全文