随笔分类 -  / 数据结构

摘要:#include <bits/stdc++.h> using namespace std; typedef long long long long; const int INF=0x3f3f3f3f; const long long mod=1e9+7; long long c1[1000005], 阅读全文
posted @ 2024-10-22 18:54 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要: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) 编辑
摘要:赞美斯特勒(stl)。 #include <bits/stdc++.h> #define int long long using namespace std; priority_queue<int,vector<int>,greater<int> >q; signed main() { int n, 阅读全文
posted @ 2024-10-08 19:43 yzc_is_SadBee 阅读(3) 评论(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) 编辑
摘要:你说的对,但是set是一种高效的数据结构,定义于bits/stdc++.h,使用std进行调用…… #include <bits/stdc++.h> using namespace std; const int maxn = 1000000; const int INF = 1e9; int n, 阅读全文
posted @ 2024-09-12 19:35 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:delicious #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; multiset<int>delta,full; int st[500100],ed[500100]; int srt=inf; int 阅读全文
posted @ 2024-09-12 19:07 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:树状数组是个好东西 # include <bits/stdc++.h> # define Fill(a, b) memset(a, b, sizeof(a)) using namespace std; const int _(3e5 + 10), INF(2e9), PF(1e5); inline 阅读全文
posted @ 2024-09-11 18:55 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:偷懒的新方法 但vector足以 #include<bits/stdc++.h> using namespace std; vector<int>v; inline int read() { char ch=getchar(); int x=0,f=1; for(; !isdigit(ch); ch 阅读全文
posted @ 2024-09-10 19:50 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:才发现蓝题以下的基本都被菜就多练的我刷掉了 from 0pts to 100pts 所以,这道题就是线段树+dp喽 #include<bits/stdc++.h> #define rep(k,l,r) for(long long k=l;k<=r;++k) #define per(k,r,l) fo 阅读全文
posted @ 2024-09-10 19:08 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0) 编辑
摘要:首先 Trie树: #include<bits/stdc++.h> using namespace std; int T,q,n,t[3000005][65],cnt[3000005],idx; char s[3000005]; int getnum(char x){ if(x>='A'&&x<=' 阅读全文
posted @ 2024-09-05 20:03 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) 编辑
摘要:第一次做扫描线 挺好的 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct ppx { int l,r; double left,right; double len; int cover 阅读全文
posted @ 2024-09-03 19:34 yzc_is_SadBee 阅读(9) 评论(0) 推荐(0) 编辑