摘要: 例题 网上查多叉转二叉好处就是好实现(好打代码)?! #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int dp[1001][1001],c[1001][1001] 阅读全文
posted @ 2021-08-17 22:31 latent_Lin 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 传送门 特别有意思的一道题 用了“分块”思想 没打代码,嘿嘿 阅读全文
posted @ 2021-08-17 22:27 latent_Lin 阅读(8) 评论(0) 推荐(0) 编辑
摘要: T4 逆向,考虑增加一条边,将两个连通块合并了 考虑新连通块的直径与原来两个连通块直径的关系 设新连通块的直径端点为 x, y,原两个连通块的直径端点为a, b, c, d。 容易发现,x, y 一定是 a, b, c, d 其中之一。 除去原先两个连通块直径长度,乘上新连通块直径长度(除法需乘法逆 阅读全文
posted @ 2021-08-16 21:42 latent_Lin 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 当n∈【30,40】可以考虑下 复杂度大概是O(2^(n/2)) 算半个模板题吧 某位机房大佬(折半+STL) #include<bits/stdc++.h> using namespace std; long long n,m,w[101],mid,a[1<<20],b[1<<20],sum1,s 阅读全文
posted @ 2021-08-13 21:26 latent_Lin 阅读(33) 评论(0) 推荐(0) 编辑
摘要: https://oi-wiki.org/ 阅读全文
posted @ 2021-08-13 16:24 latent_Lin 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 原题在此 某位大佬用线段树做的 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int N=3e5+7; inline int read(){ i 阅读全文
posted @ 2021-08-12 21:43 latent_Lin 阅读(67) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int sum,tree[300005],ll[300005],rank[300005],n; struct Node{ int num,val; 阅读全文
posted @ 2021-08-12 19:31 latent_Lin 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 神奇!!! 阅读全文
posted @ 2021-08-11 19:46 latent_Lin 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 传送门 某位师兄出的题 也可当01trie模板用 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<algorithm> #include<queue> #defi 阅读全文
posted @ 2021-08-10 22:01 latent_Lin 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> using namespace std; int a[100001]={0}; int dg_sort(int l,int r){ int mid=a[(l+r)/2]; int i=l,j=r; while(i<=j){ wh 阅读全文
posted @ 2021-08-10 21:57 latent_Lin 阅读(34) 评论(0) 推荐(0) 编辑