自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 ccc 2016 s3

把选中的点和它们的lca标记一下,然后考虑标记的点组成的这棵树。答案是:路径长度和 * 2 - 直径 想办法把选中的点和连接它们的点和边弄出来重新建棵树 以一个选中的点作为根,然后dfs,对每一个非选中的点,根据子树是否有选中的点来决定它是否要选 复杂度为 O(n)

2016-08-30 23:24:45 272

原创 ccc 2016 s4

#include #include #include using namespace std; const int maxn = 400 + 5; int n; int a[maxn]; int s[maxn]; void init() { scanf("%d", &n); for (int i = 0 ; i < n; i++) scanf("%d", &a[i]); s[0]

2016-08-30 23:11:08 201

原创 ccc 2016 s4 Combining Riceballs

Problem Description Alphonse has N rice balls of various sizes in a row. He wants to form the largest rice ball possiblefor his friend to eat. Alphonse can perform the following operations: • If two

2016-08-30 23:07:21 448

原创 ccc 16 s4 Combining Riceballs

Alphonse has N rice balls of various sizes in a row. He wants to form the largest rice ball possible for his friend to eat. Alphonse can perform the following operations: • If two adjacent rice balls

2016-08-30 22:52:51 503

原创 AVL Tree

A simple implementation of AVL tree.

2016-08-13 16:25:18 193

空空如也

空空如也

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

TA关注的人

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