02 2025 档案
ABC394
摘要:A. 22222 模拟 代码实现 s = input() print('2'*s.count('2')) B. cat 模拟 代码实现 n = int(input()) print(''.join(sorted((input() for _ in range(n)), key=len))) C. D
阅读全文
ABC393
摘要:A. Poisonous Oyster 简单分讨 代码实现 #include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int ans = 1; if (s1 == "fine"
阅读全文
YACS2025年1月甲组
摘要:T1: 树的直径(二) 考虑由关键点构成的虚树,答案一定是 。 由于关键点中深度最深的点一定是直径的某个端点,所以只需找到这个点,然后遍历其他点,通过lca求出两点间的距离,取最大值即可。 也可以跑两遍dfs求虚树直径,具体做法如下: 从任
阅读全文
ABC392
摘要:A. Shuffled Equation 排序 代码实现 a, b, c = sorted(map(int, input().split())) if a*b == c: print('Yes') else: print('No') B. Who is Missing? 模拟 代码实现 #inclu
阅读全文