Loading

上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: A - illegal 判断。 #include<bits/stdc++.h> using namespace std; int l; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>s; 阅读全文
posted @ 2026-03-29 00:08 Seqfrel 阅读(308) 评论(0) 推荐(1)
摘要: 动态维护前缀的数据结构。以下均以前缀和为例。 构造树状数组 对于长度为 \(n\) 的原始数组 \(A\),我们把元素两两合并,在此之上再把区间两两合并,直到合并到整个数组,把这些区间的和存下来构造辅助数组,即可以把每个区间拆成不超过 \(\log n\) 个区间,以达到快速修改单点和查询区间的目的 阅读全文
posted @ 2026-03-27 23:57 Seqfrel 阅读(29) 评论(0) 推荐(1)
摘要: 双连通分量 割边:无向图中,删除这条边会使图不连通的边(又叫桥)。 割点:无向图中,删除这个点会使图不连通的点。 边双连通:两点 \(u,v\) 间不存在割边,就称 \(u,v\) 边双连通。即:删去 \(u,v\) 间任意一边,\(u,v\) 仍然连通。 点双连通:两点 \(u,v\) 间不存在割 阅读全文
posted @ 2026-02-27 18:35 Seqfrel 阅读(14) 评论(0) 推荐(0)
摘要: 题意 给定一个长为 \(N\) 的区间,\(M\) 次区间推平操作。问区间上最后有多少个不同的值。 思路 离散化 区间可能有 \(10^7\) 这么长,但是只进行 \(1000\) 次推平操作。考虑对区间离散化,因为我们只关注区间端点的大小关系。但只离散化端点会造成一个问题:若一区间两端点都被其他区 阅读全文
posted @ 2026-02-26 11:58 Seqfrel 阅读(29) 评论(0) 推荐(1)
摘要: 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 阅读(116) 评论(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 阅读(53) 评论(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 阅读(30) 评论(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 阅读(50) 评论(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 阅读(64) 评论(0) 推荐(1)
摘要: 以上是图论经典问题:科尼斯堡七桥问题,由欧拉于 1736 年提出,旨在探讨图上的一笔画问题。 欧拉路径、欧拉回路 欧拉路径:图中经过所有边恰好一次的路径(即一笔画)。若该路径的起点与终点相同,则称其为一条欧拉回路。 判断 判断一个连通图是否存在欧拉路径: 有向图欧拉路径:图中恰存在 \(1\) 点, 阅读全文
posted @ 2026-01-07 23:19 Seqfrel 阅读(130) 评论(0) 推荐(1)
上一页 1 2 3 4 5 6 ··· 8 下一页