04 2022 档案
摘要:设是以结点为根的方案数,设左子树的根为,右子树的根为,那么如果左右子树完全相同,那么我们交换左右子树对方案没有任何影响,都是: 如果左右子树不相同,那么则多出的贡献,所以方案数为$f[v] =
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 100; int tr[N]; int main() { int n; cin >> n; memset(tr, -1, sizeof(tr)); for (int i = 1;
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int N = 300; vector<pair<int, int>> g[N]; int have[N]; int pre[N]; int
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; const int N = 1E5 + 10; ll stk[N]; ll top; ll x[N], y[
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int N = 10010; vector<int> G[N]; bool st[N]; int dist[N]; int res = 1e
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 550; using pii = pair<int, int>; struct Node{ int v, length, time; }; vector<Node> g[N]; i
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int N = 1210, M = 15; int n, m, k, ds; unordered_map<string, int> var;
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; bool vis[1300][130][70]; int dx[5] = {-1, 0, 1, 0, 0}, dy[5] = {0, 1, 0, -1, 0}; int
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; int f[N]; bool havef[N]; int Size[N]; int find(int x) { if (x != f[x]) f[x] = find(f
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1E5 + 10; int tr[N]; stack<int> stk; int lowbit(int x) { return x & -x; } void add(int x,
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int N = 10010, M = 110; int f[M]; int n, m; int w[N]; int pre[N]; bool
阅读全文
摘要:这题读懂题目之后就发现它很呆 #include <bits/stdc++.h> using namespace std; const int N = 100010, M = 110; vector<int> g[N]; int main() { ios::sync_with_stdio(false)
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 10010, M = 110; int main() { int n, m; cin >> n >> m; vector<vector<int>> v(n, vector<int>
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 10010; vector<int> g[N]; bool st[N]; int cnt = 0; vector<int> res; vector<int> temp; int d
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 110; stack<char> stk[N]; int main() { int n, m, S; cin >> n >> m >> S; for (int i = 1; i <
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 210; int w[N][N]; int main() { int n, m; cin >> n >> m; memset(w, -1, sizeof w); while (m-
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 50; int tr[N]; int n; void dfs(int cnt) { if (cnt > n) return; dfs(cnt * 2); dfs(cnt * 2 +
阅读全文
摘要:重点在阅读理解能力 身份证号必须是18位数字,话说平时咱们身份证也可以带个X啥的啊。 合法状态就是只要身份证合格就行,一开始我还想是它犯病,然后申请了口罩才算一个合法记录。 后边输出状态为1的人,一定要按照每个人犯病顺序输出,也就是说如果某个人一开始没犯病,后边犯病了,那取它在后边的顺序。 这样模拟
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int cal(int a, int b, char c) { int t; if (c == '/' && b == 0) t = -1; else if (c == '+') t = a + b; els
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, k; cin >> n >> m >>
阅读全文
摘要:并没有说根是谁 #include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int N = 1E5 + 10; vector<int> g[N]; int depth[N]; bool flag[N]
阅读全文
摘要:需要注意的地方: 我们只记录维京人的祖先,除了维京人的其他人不能记录它的祖先 #include <bits/stdc++.h> using namespace std; struct people { string name, familyname; char gender; }; map<stri
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; bool isyifu[10010]; bool isunhappy[10010]; bool ishappy[10010]; int tran(int x) { int res = 0; while (x)
阅读全文