随笔分类 - 题 / 数据结构
摘要:#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],
阅读全文
摘要: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++)
阅读全文
摘要:赞美斯特勒(stl)。 #include <bits/stdc++.h> #define int long long using namespace std; priority_queue<int,vector<int>,greater<int> >q; signed main() { int n,
阅读全文
摘要: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<
阅读全文
摘要:你说的对,但是set是一种高效的数据结构,定义于bits/stdc++.h,使用std进行调用…… #include <bits/stdc++.h> using namespace std; const int maxn = 1000000; const int INF = 1e9; int n,
阅读全文
摘要: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
阅读全文
摘要:树状数组是个好东西 # 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
阅读全文
摘要:偷懒的新方法 但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
阅读全文
摘要:才发现蓝题以下的基本都被菜就多练的我刷掉了 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
阅读全文
摘要:首先 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<='
阅读全文
摘要:这是rmq 半懂不懂(因为已经会线段树了) 但是!它的代码真的好短啊啊啊啊啊! #include <bits/stdc++.h> using namespace std; int dp1[500010][20],dp2[500010][20],w[1000010]; int main(){ int
阅读全文
摘要:第一次做扫描线 挺好的 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct ppx { int l,r; double left,right; double len; int cover
阅读全文