自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dust_heart的博客

Fly to sky, chase my dream!

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

原创 区间DP小结(附经典例题)

——这篇文章主要想总结下区间DP的经典题目,同时给自己复习巩固这方面知识点。区间DP一、定义区间DP,顾名思义是在区间上DP,它的主要思想就是先在小区间进行DP得到最优解,然后再利用小区间的最优解合并求大区间的最优解。二、实现思路下面给出区间DP最简单形式的伪代码(具体要根据题目修改)//mst(dp,0) 初始化DP数组for......

2017-08-13 12:50:24 25434 1

原创 2017 ACM/ICPC 广西邀请赛||HDU 6185 Covering 【状压DP+矩阵快速幂】

2017 ACM/ICPC 广西邀请赛||HDU 6185 Covering 【状压DP+矩阵快速幂】Bob's school has a big playground, boys and girls always play games here afterschool.To protect boys and girls from getting hurt when playing happily on theplayground, rich boy Bob decided to cover the

2017-08-31 17:26:45 2228 4

原创 Codeforces 842C - Ilya And The Tree 【树上DFS】

Codeforces 842C - Ilya And The Tree 【树上DFS】 Ilya is very fond of graphs, especially trees. During his lasttrip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written oneach vertex of the tree; the number w

2017-08-30 09:26:32 1657 4

原创 2017 Multi-University Training Contest 10 && HDU 6178 Monkeys 【贪心||树形DP】

2017 Multi-University Training Contest 10 && HDU 6178 Monkeys 【贪心||树形DP】 There is a tree having N vertices. In the tree there are K monkeys (K <= N). A vertex can be occupied by at most one monkey. They want to remove some edges and leave minimum edges, b

2017-08-25 21:01:46 475

原创 2017 Multi-University Training Contest 9 && HDU 6166 Senior Pan 【最短路+思维】

2017 Multi-University Training Contest 9 && HDU 6166 Senior Pan 【最短路+思维】 SeniorPan fails in his discrete math exam again. So he asks Master ZKC to give himgraph theory problems everyday.The task is simple : ZKC will give Pan a directed graph every time,

2017-08-23 12:11:08 373

原创 2017中国大学生程序设计竞赛 - 网络选拔赛 && HDU 6156 Palindrome Function 【数位DP】

2017中国大学生程序设计竞赛 - 网络选拔赛 && HDU 6156 Palindrome Function 【数位DP】 As we all know,a palindrome number is the number which reads the same backward as forward,such as 666 or 747.Some numbers are not the palindrome numbers in decimal form,but in other base,they

2017-08-21 12:23:32 332

原创 组合数学之放球问题 【附斯特林数】

组合数学之放球问题放球问题在组合数学中是一个经典问题,在ACM比赛中也经常会出现类似的题目,这里做一个归纳。我们假定现在有n个球,要放到m个盒子中,根据情况的不同主要可以分为一下8类(这里确保n>=m)一、 球相同,盒相同,允许空盒 二、 球相同,盒相同,不允许空盒三、 球相同,盒不相同,不允许空盒 四、 球相同,盒不相同,允许空盒五、 球不相同,盒相同,不允许空盒 六、 球不相同,盒相同,允许空盒六、 球不相同,盒相同,允许空盒 八、 球不相同,盒不

2017-08-19 21:08:23 2687

原创 2017 Multi-University Training Contest 7 && HDU 6121 Build a tree 【思维】

2017 Multi-University Training Contest 7 && HDU 6121 Build a tree 【思维】Problem DescriptionHazelFan wants to build a rooted tree. The tree hasn nodes labeled 0 ton−1, and the father of the node labeledi is the node labeled ⌊(i−1)/k⌋. HazelFan wonders the s

2017-08-15 21:28:08 829

原创 HDU 5692 Snacks 【DFS序+线段树】

SnacksTime Limit: 10000/5000 MS (Java/Others)    Memory Limit:65536/65536 K (Java/Others)Total Submission(s): 3282    Accepted Submission(s): 762Problem Description百度科技园内有n个零食机,零食机之间通过n−1条路相互连通。每个零食机都...

2017-08-12 10:52:36 454

原创 2017 Multi-University Training Contest 6 && HDOJ 6105 Gameia 【树形博弈】

2017 Multi-University Training Contest 6 && HDOJ 6105 Gameia 【树形博弈】 Alice and Bob are playing a game called 'Gameia ? Gameia !'. The game goes like this :0. There is a tree with all node unpainted initial.1. Because Bob is the VIP player, so Bob has K c

2017-08-10 20:20:48 628 2

原创 2017 Multi-University Training Contest 5 &&HDU 6085 Rikka with Candies 【bitset+思维】

HDU 6085 Rikka with Candies 【bitset】As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:There are nchildren and mkinds of candies. The ith child has Aidol

2017-08-09 17:01:25 398

原创 HDOJ 2588 GCD 【欧拉函数】 附数据加强版 【Miller_Rabin+Pollard_Rho算法】

HDOJ 2588 GCD 【欧拉函数】 附数据加强版 【Miller_Rabin+Pollard_Rho算法】The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,Forexample,(1,2)=1,(12,18)=6.(a,b) can be easily found by the E

2017-08-08 23:11:44 481

原创 2017"百度之星"程序设计大赛 - 资格赛 &&HDOJ6084 寻找母串 【卡特兰数+分块打表】

HDOJ6084 【卡特兰数+分块打表】对于一个串S,当它同时满足如下条件时,它就是一个01偏串:1、只由0和1两种符组成;2、在S的每一个前缀中,0的个数不超过1的个数;3、S中0的个数和1的个数相等。现在给定01偏串S,请计算一下S在所有长度为n的01偏串中作为子串出现的次数的总和。由于结果比较大,结果对1e9+7取余后输出。样例解释:在第二个样例中,长度为4的偏串共两个1010,1100。10在1010中出现了两次,在1100中出现了1次。所以答案是3。

2017-08-07 15:10:55 843

原创 Codeforces 837D - Round Subset 【DP】

Codeforces 837D - Round Subset 【DP】 Let's call the roundness of the number the number of zeros to which it ends.You have an array of n numbers. You need to choose a subset of exactly k numbers so that the roundness of the product of the selected numbers

2017-08-04 02:16:34 1618

原创 2017 Multi-University Training Contest 4 && HDOJ 6069 Counting Divisors 【区间筛法】

2017 Multi-University Training Contest 2 && HDOJ 6069 Counting Divisors 【区间筛法】In mathematics, the function d(n)denotes the number of divisors of positive integer n.For example, d(12)=6because 1,2,3,4,6,12are all 12's divisors.In this problem

2017-08-03 20:29:22 415

原创 Codeforces 466E - Information Graph 【DFS+并查集+预处理】

Codeforces 466E - Information Graph 【DFS+并查集+预处理】 There are n employees working in company "X" (let's number them from 1 to n for convenience). Initially the employees didn't have any relationships among each other. On each of m next days one of the foll

2017-08-02 17:05:47 535

原创 Codeforces 835D - Palindromic characteristics 【区间DP+回文串】

Codeforces 835D - Palindromic characteristics 【区间DP+回文串】 Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number ofnon-empty substrings of s which are k-palindromes.A string is 1-palin

2017-08-02 11:07:59 582

原创 2017 Multi-University Training Contest 3 && HDOJ 6058 Kanade's sum 【链表模拟】

2017 Multi-University Training Contest 3 && HDOJ 6058 Kanade's sum 【链表模拟】 Give you an array A[1..n]of length n. Let f(l,r,k)be the k-th largest element of A[l..r].Specially , f(l,r,k)=0if r−l+1<k.Give you k, you need to calculate ∑n

2017-08-01 23:45:58 485

原创 Codeforces 835C - Star sky 【预处理前缀和】

Codeforces 835C - Star sky 【DP+前缀和】 The Cartesian coordinate system is set in the sky. There you cansee n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initialbrightness si (0 ≤ si ≤ c).Over time the stars

2017-08-01 01:43:13 2496

空空如也

空空如也

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

TA关注的人

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