自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(3)
  • 收藏
  • 关注

原创 树的重心(代码实现)

1.树最多有两个重心 2.如果树有两个重心那么它们两两相邻 #include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int N = 200010; vector<int> h[N]; int n; int res = N; int dfs(int u,int fa) { int sum = 1;

2022-05-19 15:31:29 201

原创 合适数对(树状数组+离散化)

题目链接 求区间和用到前缀和,将区间和分类,分成n类,每类都以i结尾,所以我们只要求在i之前的区间和大于等于s[i]-m的数量,所以可以用树状数组维护,因为数值范围很大,所以再加一步离散化 #include<iostream> #include<algorithm> #include<string> #include<cstring> #include<vector> const int N = 400010; using namespace st

2022-04-25 13:38:50 123

原创 Codeforces Round #753 (Div. 3)

A出三道一把掉分局,痛定思痛,写篇总结 A. Linear Keyboard 应用数组或者哈希表简单模拟即可 #include<iostream> #include<algorithm> #include<cstring> #include<vector> #include<cmath> #include<string> #include<queue> #include<unordered_map> using

2021-11-03 19:30:51 148

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除