摘要: # A1. Dual (Easy Version) https://codeforces.com/contest/1854/problem/A1 ## 题意 给定一个长度为 $n$ 的序列 $a_1, a_2, \dots, a_n$,你可以做以下操作: - 选定两个下标 $i, j(1 \leq 阅读全文
posted @ 2023-07-30 11:33 CountingGroup 阅读(199) 评论(0) 推荐(1) 编辑
摘要: https://codeforces.com/contest/1852/problems # A. Ntarsis' Set https://codeforces.com/contest/1852/problem/A ![image](https://img2023.cnblogs.com/blog 阅读全文
posted @ 2023-07-24 17:23 CountingGroup 阅读(82) 评论(0) 推荐(0) 编辑
摘要: # 一、LCA ```cpp struct LCAns { struct edge {int to, nxt;} e[N = 0; -- j) {if (d[dp[u][j]] >= d[v]) u = dp[u][j];} if (u == v) return u; for (int j = lg 阅读全文
posted @ 2023-07-22 17:56 CountingGroup 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 一、2-SAT 2-SAT 问题是给定 \(n\) 个变量 \(x_1, x_2, \dots, x_n\),取值只有 \(0\) 或 \(1\),然后这些变量要满足一些条件,比如:如果 \(x_1 = 1\) 那么 \(x_2 = 0\) 之类的。 然后我们要解决的问题就是判定是否存在一组 \(( 阅读全文
posted @ 2023-07-16 15:54 CountingGroup 阅读(9) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2023-07-16 11:25 CountingGroup 阅读(18) 评论(0) 推荐(0) 编辑
摘要: # 一、定义 在 **无向连通图** $G = (V, E)$ 中,若存在一个点 $u(u \in V)$ 使得删掉点 $u$ 及其相连的边,会使原图不连通,就称 $u$ 是原图的一个 **割点 (cut vertex)**;若存在一条边 $(u, v)((u, v) \in E)$ 满足删掉 $( 阅读全文
posted @ 2023-07-11 21:01 CountingGroup 阅读(17) 评论(0) 推荐(0) 编辑
摘要: # 一、启发式合并 启发式合并多用于合并两个集合,现在有这样一个问题: 现在给定 $n$ 个集合,第 $i$ 个集合初始只有 $\{i\}$,要支持集合的合并操作。 如果我们暴力合并,时间复杂度会是 $O(n^2)$ 的。 参考并查集的按秩合并,考虑将小的集合合并到大的集合上。 考虑计算时间复杂度, 阅读全文
posted @ 2023-07-09 09:28 CountingGroup 阅读(83) 评论(0) 推荐(0) 编辑
摘要: https://atcoder.jp/contests/abc308/tasks_print # A - New Scheme 过水已隐藏。 ```cpp #include #include #include #include using namespace std; using namespace 阅读全文
posted @ 2023-07-07 21:10 CountingGroup 阅读(14) 评论(0) 推荐(0) 编辑
摘要: Find Problems: - https://www.luogu.com.cn/problem/list?type=CF&keyword=%E5%BC%BA%E8%BF%9E%E9%80%9A%E5%88%86%E9%87%8F&page=1 - https://www.luogu.com.cn 阅读全文
posted @ 2023-06-23 22:00 CountingGroup 阅读(17) 评论(0) 推荐(0) 编辑
摘要: - 打开 https://tool.chinaz.com/dns/ ,输入 github.com,复制任意响应 IP。 - 打开 `C:\Windows\System32\drivers\etc` 下的 `hosts`,用 Sublime Text 打开,加上 `IP地址 + 空格 + github 阅读全文
posted @ 2023-06-23 19:36 CountingGroup 阅读(318) 评论(0) 推荐(0) 编辑