摘要:
bwtree 我们可以设 \(dp_{i, 0/1}\) 表示当前考虑至哪个点,这个节点的子树内选了几个叶子节点 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5, INF = 1e9; int n, a[N], 阅读全文
摘要:
The Only Way to the Destination 首先假如两个墙之间的间隔大于等于二了,那么就直接输出 \(no\),如果能在图的空隙中找到一个 \(2 * 2\) 的矩形,那么也是输出 \(no\),然后我们可以把每一列看成一个点,再把每个空隙看成一条边即可,用并查集维护 A Sim 阅读全文
摘要:
String of yuusaan 我们可以打表,我们会发现字符串无论重复多少次都会遵循这个规律 #include <bits/stdc++.h> using namespace std; #define int long long int a, b; signed main() { cin >> 阅读全文
摘要:
Tree Journey 猜结论 #include <bits/stdc++.h> using namespace std; #define int long long const int N = 1e5 + 5; int n, k, ans, dep[N]; vector<int> g[N]; v 阅读全文
摘要:
Red Pandaships 我们会发现如果有奇数个熊猫被夹在两个熊猫之间,那么一定会相交 #include <bits/stdc++.h> using namespace std; #define int long long const int N = 3e5 + 5; int t, n, m; 阅读全文