摘要: #include <bits/stdc++.h> using namespace std; const int N=100005,inf=0x7fffffff; struct node{ int l,r,val,dat,cnt,size; }a[N]; int tot,root,n; int New 阅读全文
posted @ 2025-07-04 14:25 wyh0721 阅读(7) 评论(0) 推荐(0)
摘要: wyh0721学习日志 2025.2.24 MON 《算法竞赛进阶指南》: 0x01 位运算 0x02 递推与递归 0x03 前缀和与差分 2025.2.25 TUE 《算法竞赛进阶指南》: 0x04 二分 0x05 排序 0x06 倍增 2025.2.26 WED 《算法竞赛进阶指南》: 0x07 阅读全文
posted @ 2025-03-22 10:24 wyh0721 阅读(41) 评论(0) 推荐(0)
摘要: 1.定义 对于无根树上的每一个点,计算其所有子树中最大的子树节点数,这个值最小的点就是这棵树的重心。 具体解释一下,如图给出的一棵树中 若以1为根节点,则它的子树为{2,4,5}和{3,6,7},最大子树的节点数为3; 若以2为根节点,则它的子树为{4},{5}和{1,3,6,7},最大子树的节点数 阅读全文
posted @ 2023-11-20 21:28 wyh0721 阅读(173) 评论(0) 推荐(4)
摘要: c(m,n)=m!/[n!*(m-n])!] c(m,n)=c(n-1,m-1)+c(n,m-1) c(m,n)=c(m-n,m) (m+n)%p=(m%p+n%p)%p (m-n)%p=(m%p-n%p+p)%p (m*n)%p=(m%p*n%p)%p (m/n)%p=(m%p*np-2%p)%p 阅读全文
posted @ 2023-09-20 21:24 wyh0721 阅读(60) 评论(18) 推荐(0)
摘要: 上午 1 #include <bits/stdc++.h> 2 #define int long long 3 using namespace std; 4 int ans[20],s; 5 signed main() 6 { 7 freopen("x3.in","r",stdin); 8 freo 阅读全文
posted @ 2023-08-05 17:04 wyh0721 阅读(42) 评论(0) 推荐(0)
摘要: 上午 1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 freopen("str.in","r",stdin); 6 freopen("str.out","w",stdout); 7 string s="a"; 阅读全文
posted @ 2023-08-05 14:53 wyh0721 阅读(18) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-08-03 17:03 wyh0721 阅读(9) 评论(0) 推荐(0)
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 struct node{ 4 int x,y,z,s; 5 }f[1005]; 6 int a[4],l,ans,dp[1005]; 7 bool cmp(node c,node d) 8 { 9 阅读全文
posted @ 2023-08-03 09:48 wyh0721 阅读(18) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-07-24 16:39 wyh0721 阅读(11) 评论(0) 推荐(0)
摘要: 线段树没学会 阅读全文
posted @ 2023-07-23 16:34 wyh0721 阅读(12) 评论(0) 推荐(0)