随笔分类 -  / 算法 / rmq

摘要:st表。(还是半懂不懂) #include <bits/stdc++.h> using namespace std; int n,m,x,y,l,a[100010],f[100010][20]; int main(){ cin>>n>>m; a[1]=0; for(int i=2;i<=n;i++) 阅读全文
posted @ 2024-10-14 20:20 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:good rmq #include<bits/stdc++.h> using namespace std; struct node { int num; int lid,rid; int w; int data; bool operator <(node i)const { return data< 阅读全文
posted @ 2024-09-18 19:07 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:这是rmq 半懂不懂(因为已经会线段树了) 但是!它的代码真的好短啊啊啊啊啊! #include <bits/stdc++.h> using namespace std; int dp1[500010][20],dp2[500010][20],w[1000010]; int main(){ int 阅读全文
posted @ 2024-09-05 19:08 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑