上一页 1 2 3 4 5 6 7 ··· 55 下一页
摘要: 题目链接:https://atcoder.jp/contests/arc030/tasks/arc030_4 题目大意:vjudge链接 现有一个长度为 \(N\) 的数列 \(X={x_1,x_2,...,x_N}\)。需要对数列执行 \(Q\) 次查询操作。查询操作共有\(3\) 种类型,具体如 阅读全文
posted @ 2025-04-23 13:57 quanjun 阅读(22) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3379 解题思路: 对一棵树进行 DFS,无论是第一次访问还是回溯,每次到达一个结点时都将编号记录下来,可以得到一个长度为 \(2n-1\) 的序列,这个序列被称作这棵树的欧拉序列。 在下文中,把结点 u 在欧拉序列中第 阅读全文
posted @ 2025-04-18 15:32 quanjun 阅读(43) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P1533 解题思路: 主席树求区间第k小模板题 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e7 + 5; const int 阅读全文
posted @ 2025-04-17 18:14 quanjun 阅读(13) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3466 解题思路完全来自 CodyTheWolf大佬的博客 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; mt 阅读全文
posted @ 2025-04-17 16:38 quanjun 阅读(11) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P2161 题目大意: 你需要维护一个在数轴上的线段的集合 \(S\),支持两种操作: A l r 表示将 \(S\) 中所有与线段 \([l,r]\) 相交的线段删去,并将 \([l,r]\) 加入 \(S\) 中。 B 阅读全文
posted @ 2025-04-15 18:34 quanjun 阅读(13) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3871 解题思路: FHQ Treap模板题,只涉及插入和 kth 操作。 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 2e5 阅读全文
posted @ 2025-04-15 18:16 quanjun 阅读(13) 评论(0) 推荐(0)
摘要: 题目链接:https://www.acwing.com/problem/content/2439/ 解题思路: 翻转,加懒惰标记 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; mt19937 阅读全文
posted @ 2025-04-15 14:27 quanjun 阅读(10) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3369 FHQ Treap 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; mt19937 rng(time(0 阅读全文
posted @ 2025-04-15 13:16 quanjun 阅读(23) 评论(0) 推荐(0)
摘要: 题目链接:https://atcoder.jp/contests/abc400/tasks/abc400_d 解题思路: 双端队列BFS(0-1 BFS)参考资料:https://oi.wiki/graph/bfs/#双端队列-bfs 比赛时我是用SPFA写的,然后TLE了一个点,然后用dijkst 阅读全文
posted @ 2025-04-05 22:31 quanjun 阅读(157) 评论(0) 推荐(0)
摘要: 题目链接:https://atcoder.jp/contests/arc084/tasks/arc084_b 题目大意: 找到一个数位和最小的整数,这个整数是 \(K(\le 10^5)\) 的倍数,输出数位和。 解题思路: 观察到任意一个正整数都可以从 \(1\) 开始,按照某种顺序执行乘 \(1 阅读全文
posted @ 2025-04-04 14:18 quanjun 阅读(15) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 55 下一页