随笔分类 -  模板

摘要:并查集 并查集(Java实现) - GoldArowana - 博客园 TODO:补充概念等知识 模板 class DSU { /** * initialSize : 初始化集合个数 * currentSize : 当前集合个数 * nodeFathers : 父节点 * nodeCounts : 阅读全文
posted @ 2023-01-29 19:14 Cattle_Horse 阅读(36) 评论(0) 推荐(0) 编辑
摘要:矩阵及其快速幂 模板 Code template <typename T> concept is_mat = requires(T a) { a.row; }; template <typename T> concept not_mat = !is_mat<T>; template <typenam 阅读全文
posted @ 2022-09-05 23:19 Cattle_Horse 阅读(25) 评论(0) 推荐(0) 编辑
摘要:modint 自动取模类模板 简单的一种 template <typename T> concept Can_bit = requires(T x) { x >>= 1; }; template <int MOD> struct modint { int val; static int norm(c 阅读全文
posted @ 2022-08-30 01:06 Cattle_Horse 阅读(1602) 评论(11) 推荐(1) 编辑
摘要:树链剖分 无权值树剖 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( 阅读全文
posted @ 2022-08-08 11:46 Cattle_Horse 阅读(41) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示