2025年2月18日
摘要: A: 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; int a[100005],b[100005][21],l[100005]; int x,y; void pre(){ for(int i=1;i<=n;i++){ b[i 阅读全文
posted @ 2025-02-18 22:52 cathy_zro 阅读(10) 评论(2) 推荐(2) 编辑
摘要: A: 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; int fa[100086]; int find(int x){ return fa[x]==x ? x : fa[x]=find(fa[x]); } void mix(i 阅读全文
posted @ 2025-02-18 22:47 cathy_zro 阅读(2) 评论(0) 推荐(0) 编辑
  2025年2月17日
摘要: A: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1e6+6; long long a[N],c[N],n,m,x,opt,k; inline int lowbit(int x){ return x&(-x); } 阅读全文
posted @ 2025-02-17 09:55 cathy_zro 阅读(9) 评论(0) 推荐(1) 编辑
摘要: A: 点击查看代码 #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; const int inf = 0x3f3f3f3f; int read () { int x = 0 , f = 1; char ch = 阅读全文
posted @ 2025-02-17 09:46 cathy_zro 阅读(10) 评论(0) 推荐(0) 编辑
  2024年12月15日
该文被密码保护。 阅读全文
posted @ 2024-12-15 16:45 cathy_zro 阅读(18) 评论(2) 推荐(1) 编辑
  2024年12月13日
摘要: Manacher,O(n)求字符串最长回文子串的良心算法 首先,求最长回文字串的两个个方法,第一个是将所有字串列出来然后逐个判断,时间复杂度高达O(n3),这里不多赘述,然后就是选择一个字符,向两边扩展,判断是否相等,相等则长度自增。时间复杂度高达O(n2) 然后就是可以用hash来判断回文,时间复 阅读全文
posted @ 2024-12-13 20:29 cathy_zro 阅读(8) 评论(0) 推荐(0) 编辑
  2024年11月27日
该文被密码保护。 阅读全文
posted @ 2024-11-27 17:10 cathy_zro 阅读(1) 评论(0) 推荐(0) 编辑
  2024年11月24日
摘要: A: 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n<0) { cout<<"-"; } n=abs(n); bool b=0; while(n>0) { if(n%10!=0) 阅读全文
posted @ 2024-11-24 14:20 cathy_zro 阅读(8) 评论(0) 推荐(0) 编辑
  2024年11月23日
摘要: 线段树,是一种支持点修点查,去修区查的高级数据结构,单词操作时间复杂度为O(log2点数),非常的优秀 拉张图来解释一下线段树: 每个父节点的权值是两个子节点权值的和 好的。首先建一棵线段树我们来采用递归建树:先从根节点DFS遍历,然后返回后使用push_up函数累加——这样就可以保证线段树的性质 阅读全文
posted @ 2024-11-23 12:04 cathy_zro 阅读(8) 评论(0) 推荐(0) 编辑
  2024年11月22日
摘要: A: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int maxx=1005; const int dx[4]={0,0,1,-1}; const int dy[4]={1,-1,0,0}; int n,sx,sy,tx,ty; 阅读全文
posted @ 2024-11-22 22:17 cathy_zro 阅读(15) 评论(0) 推荐(0) 编辑

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