03 2023 档案

摘要:P3369 【模板】普通平衡树 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 100010, INF = 1e9; struct Node { int ch 阅读全文
posted @ 2023-03-16 08:45 SunnyYuan 阅读(70) 评论(1) 推荐(1) 编辑
摘要:点分治,重心分治。 使用场景:树上大量路径统计问题。 算法原理: 按照重心划分树,可以使划分的时间复杂度 O(logn)。 分治的思想在于,讨论每一棵子树时,经过或者不经过根节点。 P3806 【模板】点分治1 题意 给定一个带权无向图,问树上有多少点对之间距离 =k 。 思路 阅读全文
posted @ 2023-03-11 19:02 SunnyYuan 阅读(38) 评论(0) 推荐(1) 编辑

more_horiz
keyboard_arrow_up dark_mode palette
选择主题
点击右上角即可分享
微信分享提示