摘要:
A. Homework 按题意模拟。 点击查看代码 #include <bits/stdc++.h> using i64 = long long; void solve() { int n, m; std::string a, b, c; std::cin >> n >> a >> m >> b > 阅读全文
摘要:
A - AtCoder Language 点击查看代码 #include <bits/stdc++.h> using i64 = long long; void solve() { std::string s; std::cin >> s; if (s == "red") { std::cout < 阅读全文
摘要:
D. Grammar Test (grammar) 找规律题。取模是吓人的。发现只有\(01010..\)或者\(101010..\)两种,然后发现长度为\(4\)加上偶数个\(3\)。 点击查看代码 #include <bits/stdc++.h> using i64 = long long; v 阅读全文
摘要:
A. AVL tree 题意:给你一棵二叉树,你每次可以删除一个点,或者对于一个缺少了某个左右儿子的节点补充一个子节点。求变成\(AVL\)树的最少操作。\(AVL\)树是指任意一个节点都有左右儿子高度差小于等于\(1\)。节点高度为左右儿子最大高度加一。空节点高度为\(0\)。 考虑一颗高度为\( 阅读全文
摘要:
A. 小红的不动点 点击查看代码 #include <bits/stdc++.h> using i64 = long long; void solve() { int a[4]{}; int ans = 0; for (int i = 0; i < 4; ++ i) { std::cin >> a[ 阅读全文