摘要: 01字典树用于处理数字的前缀 例题: https://codeforces.ml/contest/1720/problem/D2 题解: https://www.bilibili.com/video/BV1mG4y1a7QS?spm_id_from=333.1007.top_right_bar_wi 阅读全文
posted @ 2022-08-22 16:40 80k 阅读(28) 评论(0) 推荐(0)
摘要: https://codeforces.ml/contest/1712/problem/E2 题解: https://www.bilibili.com/video/BV1uB4y167ig?spm_id_from=333.1007.top_right_bar_window_view_later.con 阅读全文
posted @ 2022-08-22 10:24 80k 阅读(18) 评论(0) 推荐(0)
摘要: 对于单次查询,可以直接用sqrt(n)遍历。 对于多次查询,每次都遍历会遍历多个无用的数。 可以采用打表法,直接获取数据范围内的全部数据的因子。 代码如下: int N = 100010; vector<int> factor[100010]; for (int i = 1; i <= N; i++ 阅读全文
posted @ 2022-08-22 09:59 80k 阅读(20) 评论(0) 推荐(0)