Loading

摘要: A - Strong Word 直接判。 #include<bits/stdc++.h> using namespace std; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>s; i 阅读全文
posted @ 2026-02-14 22:37 Seqfrel 阅读(59) 评论(0) 推荐(1)
摘要: A - Repdigit 直接判三个数字。 #include<bits/stdc++.h> using namespace std; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>s; 阅读全文
posted @ 2026-02-08 23:01 Seqfrel 阅读(20) 评论(0) 推荐(1)
摘要: A - Append s 模拟即可。 #include<bits/stdc++.h> using namespace std; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>s; cou 阅读全文
posted @ 2026-02-03 11:46 Seqfrel 阅读(5) 评论(0) 推荐(1)
摘要: A - Count . 直接模拟即可。 #include<bits/stdc++.h> using namespace std; string s; int ans; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); c 阅读全文
posted @ 2026-02-01 19:33 Seqfrel 阅读(17) 评论(0) 推荐(1)
摘要: 一个 \(O(n\log n)\) 预处理,\(O(1)\) 求 LCA 的科技。 欧拉序 图来自 Luogu @Rainbow_qwq。 欧拉序即为 DFS 序中添加回溯经过的节点。 此树的欧拉序为 \(1→2→4→7→4→8→4→2→5→2→1→3→6→3→1\)。 欧拉序求 LCA 欧拉序的性 阅读全文
posted @ 2026-01-09 20:57 Seqfrel 阅读(41) 评论(0) 推荐(1)
摘要: 以上是图论经典问题:科尼斯堡七桥问题,由欧拉于 1736 年提出,旨在探讨图上的一笔画问题。 欧拉路径、欧拉回路 欧拉路径:图中经过所有边恰好一次的路径(即一笔画)。若该路径的起点与终点相同,则称其为一条欧拉回路。 判断 判断一个连通图是否存在欧拉路径: 有向图欧拉路径:图中恰存在 \(1\) 点, 阅读全文
posted @ 2026-01-07 23:19 Seqfrel 阅读(101) 评论(0) 推荐(1)
摘要: A - 2^n - 2*n 直接计算即可。 #include<bits/stdc++.h> using namespace std; int n; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>n; cou 阅读全文
posted @ 2026-01-03 22:45 Seqfrel 阅读(124) 评论(0) 推荐(0)
摘要: 思路 首先第一问是裸的树的直径,因为没有负权边而且第二问会用到直径的两个端点,所以使用两次 DFS 求解。 接着考虑第二问。借用洛谷题解区的一张图: 当我们已经算出来一条直径后,就要刨掉那些分叉的边。当一个当前直径上的点到其子树内最深的距离(不包含已经是当前直径上的点)等于这个点到其子树内那个已知的 阅读全文
posted @ 2025-12-31 22:44 Seqfrel 阅读(13) 评论(0) 推荐(0)
摘要: A - Feet 直接代入计算。 #include<bits/stdc++.h> using namespace std; int a,b; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>a>>b; cou 阅读全文
posted @ 2025-12-28 22:40 Seqfrel 阅读(37) 评论(0) 推荐(0)
摘要: 校内 test1226 T1~T4 题解。密码提示:教练用户名+机房号。 阅读全文
posted @ 2025-12-26 22:02 Seqfrel 阅读(1) 评论(0) 推荐(0)