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 阅读全文
posted @ 2025-02-23 00:53 V_Melville 阅读(24) 评论(0) 推荐(0) 编辑
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" 阅读全文
posted @ 2025-02-16 23:13 V_Melville 阅读(10) 评论(0) 推荐(0) 编辑
YACS2025年1月甲组
摘要:T1: 树的直径(二) 考虑由关键点构成的虚树,答案一定是 2。 由于关键点中深度最深的点一定是直径的某个端点,所以只需找到这个点,然后遍历其他点,通过lca求出两点间的距离,取最大值即可。 也可以跑两遍dfs求虚树直径,具体做法如下: 从任 阅读全文
posted @ 2025-02-12 21:47 V_Melville 阅读(12) 评论(0) 推荐(0) 编辑
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 阅读全文
posted @ 2025-02-09 01:09 V_Melville 阅读(42) 评论(0) 推荐(0) 编辑
ABC391
摘要:A. Lucky Direction 模拟 代码实现 d = {'N' : 'S', 'S' : 'N', 'W' : 'E', 'E' : 'W'} print(''.join(d[c] for c in input())) B. Seek Grid 暴搜 代码实现 #include <bits/ 阅读全文
posted @ 2025-02-02 01:10 V_Melville 阅读(56) 评论(0) 推荐(0) 编辑

 
点击右上角即可分享
微信分享提示