自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

lifelike

lifelike

  • 博客(9)
  • 收藏
  • 关注

原创 2017-2018 Northwestern European Regional Contest (NWERC 2017) K - Knockout Tournament 贪心 建完全二叉树 暴力

题目点我题意:给出n个人 打分组淘汰赛,允许轮空。给出每个人的实力,实力为a的人打实力为b的人的胜率为a/(a+b)问编号为1的人夺冠的胜率是多少解题思路 n才4096 可以往暴力的方面去想。很容易想到的贪心策略是按照2-n号按实力排序,这样子建一颗二叉树然后就是如何建树,一开始想用线段树的模板建树,发现建出来的树是漏的。其实再改一改就好了void build(int l,in...

2018-10-31 15:33:59 298

原创 SWERC 2017 D - Candy Chain 字典树优化区间DP

D: Candy ChainA Candy Chain is a sequence of individual candies. Candies come in 26 different flavors identified bythe lowercase letters a to z. Margot has a particularly fancy Candy Chain displayed...

2018-10-22 22:19:25 483 1

原创 Counting Cycles Aizu - 1388 虚树 模板题

点我看题题意 给出一个图 ,问其中有多少个简单环。边数最多比点数多15解题思路边数最多比点数多15。 这是一个很经典的条件。 1.想到状压枚举,2.想到建出生成树,然后暴力加边。思考枚举边的时候如何判断是否有环。这是一个图论小技巧,将选出来的边的端点 往上异或边异或到根节点, 异或完成后,所有值等于1的边就是应该要选的边。然后暴力判断这些边是否能构成一个简单环即可。 但这样 复杂度会...

2018-10-20 22:56:52 303

原创 2017-2018 ACM-ICPC, Asia Tsukuba Regional Contest B - Parallel Lines

PS: 这是一道签到题, RB强者 恐怖如斯。 Given an even number of distinct planar points, consider coupling all of the points into pairs. All the possible couplings are to be considered as long as all the given points...

2018-10-19 17:01:18 478

原创 codeforce 1041 E. Tree Reconstruction 思维题

E. Tree Reconstructiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMonocarp has drawn a tree (an undirected connected acyclic graph) and then ha...

2018-10-11 20:04:29 229

原创 codeforce 802 H. Fake News (medium) 构造 套路题

H. Fake News (medium)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThanks to your help, Heidi is confident that no one can fool her. She has now ...

2018-10-06 13:44:09 583

原创 Educational Codeforces Round 25 F. String Compression KMP找循环节+简单

F. String Compressiontime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputIvan wants to write a letter to his friend. The letter is a string s con...

2018-10-05 17:50:38 203

转载 如何利用KMP的next求字符串的循环节 【转】

点我看原文利用KMP算法中的next值可以求出字符串的循环节,如ababab的循环节为ab,abcd的循环节为abcd,具体做法如下:假设字符串的长度为len,next[len]为字符串的最后一个字符的下一个字符的next值(下标从0开始),如果len% (len - next[len]) == 0,那么循环节的循环次数为len / (len -next[len]),否则为1,为什么呢?详细...

2018-10-05 14:48:14 335

原创 codeforces856 B Similar Words 模型转换 tree图建图+树形dp

B. Similar Wordstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputLet us call a non-empty sequence of lowercase English letters a word. Prefix ...

2018-10-04 20:40:16 198

空空如也

空空如也

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

TA关注的人

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