HDU
SolitaryOrz
ACM最弱传说
展开
-
【笔记】HDU 6853 [2020hdu多校第七场1010]
SourceHDU 6853Solution求在坐标图上,随意游走,回到起点的概率。只能游走gcd(x,y) > 1的坐标。bfs跑全图,然后记录度。答案计算方式见Note.Note来源:HDU 2020 多校第七场 游记 ——WAautomatonCode/* * @Author: SolitaryOrz * @Date: 2020-08-19 17:29:23 * @Last Modified by: SolitaryOrz * @Last Modified time原创 2020-08-21 23:29:05 · 258 阅读 · 0 评论 -
hdu 6804【2020杭电多校赛第四场1003】【负值01背包】【random_shuffle】
Sourcehdu 6804 Contest of Rope PullingSolution有两个班级,一班有n个人,二班有m个人,每个人都有力气值和美丽值,从两个班分别选出力气之和相同的任意个人(可以全选也可以不选)。并使它们的美丽值最大。实际上我们可以把题目转化成01背包问题:n+m个物品,把力气作为cost,把美丽值作为value,一班的cost做负贡献,二班的cost做正贡献,最后取dp[0]即可。但是根据题目给出的数据范围,dp[x]的x范围最大为-106~106。我看了官方题解之后,才原创 2020-07-31 20:08:40 · 402 阅读 · 3 评论 -
HDU 6795【2020杭电多校赛第三场1005】【并查集】【组合数学】
Little W and ContestSourseHDU 6795 Little W and ContestSolution有两种人,读题的和写代码的,读题的人能力值是1,写代码的人能力值是2,组成一个团队最少需要能力5,所以至少要有2个写代码的人才能组成一个团队。团队里的人,任意两个人不能互相认识。每个回合教练都会介绍任意两个人认识(因此这两人不能在同一个团队里),并且认识的人之间具有传递性,即题目说明了a认识b,说明了b认识c,a就会视作认识c。问每个回合过后有多少种组成团队的方式。这种点原创 2020-07-29 19:03:06 · 170 阅读 · 0 评论 -
HDU 6628 [2019 Multi-University Training Contest 5]
permutation 1Problem DescriptionA sequence of length n is called a permutation if and only if it’s composed of the first n positive integers and each number appears exactly once.Here we define the ...原创 2019-08-06 14:59:59 · 248 阅读 · 0 评论 -
HDU 6616 [2019 Multi-University Training Contest 4]
Divide the StonesProblem DescriptionThere are n stones numbered from 1 to n.The weight of the i-th stone is i kilograms. We divide the stones into k groups.Each group consists of exactly stones.W...原创 2019-08-02 14:44:04 · 165 阅读 · 0 评论 -
HDU 6685 [2019 Multi-University Training Contest 9]
Rikka with CoinProblem DescriptionRikka hates coins, and she used to never carry any coins with her. These days, Rikka is doing her summer internship abroad. Without mobile payment, Rikka has to fac...原创 2019-08-20 13:03:34 · 164 阅读 · 0 评论 -
HDU 6656 [2019 Multi-University Training Contest 7]
Kejin PlayerProblem DescriptionCuber QQ always envies those Kejin players, who pay a lot of RMB to get a higher level in the game. So he worked so hard that you are now the game designer of this gam...原创 2019-08-15 14:38:49 · 132 阅读 · 0 评论 -
HDU 6659 [ 2019 Multi-University Training Contest 8]
Acesrc and Good NumbersProblem DescriptionAcesrc is a famous mathematician at Nanjing University second to none. Playing with interesting numbers is his favorite. Today, he finds a manuscript when c...原创 2019-08-15 10:26:55 · 281 阅读 · 0 评论 -
HDU 6693 [2019 Multi-University Training Contest 10]
Valentine’s DayProblem DescriptionOipotato loves his girlfriend very much. Since Valentine’s Day is coming, he decides to buy some presents for her.There are n presents in the shop, and Oipotato ca...原创 2019-08-22 10:16:34 · 376 阅读 · 0 评论 -
HDU 5573 【贪心】
Binary TreeProblem DescriptionThe Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary tr...原创 2019-09-30 19:35:52 · 114 阅读 · 0 评论 -
HDU 2089 【数位dp入门学习】
不要62Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和...原创 2019-08-02 10:57:32 · 130 阅读 · 0 评论 -
HDU 6638 [2019 Multi-University Training Contest 6]
Snowy SmileProblem DescriptionThere are n pirate chests buried in Byteland, labeled by 1,2,…,n. The i-th chest’s location is (xi,yi), and its value is wi, wi can be negative since the pirate can add...原创 2019-08-08 14:50:20 · 152 阅读 · 0 评论 -
HDU 6601 [2019 Multi-University Training Contest 2]
Keen On Everything But TriangleProblem DescriptionN sticks are arranged in a row, and their lengths are a1,a2,…,aN.There are Q querys. For i-th of them, you can only use sticks between li-th to ri-...原创 2019-08-02 17:07:43 · 134 阅读 · 0 评论 -
HDU 6579 [2019 Multi-University Training Contest 1]
OperationProblem DescriptionThere is an integer sequence a of length n and there are two kinds of operations:0 l r: select some numbers from al…ar so that their xor sum is maximum, and print the ma...原创 2019-08-03 16:20:11 · 131 阅读 · 0 评论 -
HDU 6581 [2019 Multi-University Training Contest 1]
Problem DescriptionTom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them. The ith...原创 2019-07-23 11:24:53 · 165 阅读 · 0 评论 -
HDU 2476
Problem DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can chang...原创 2019-07-27 10:24:05 · 308 阅读 · 0 评论 -
HDU 5115
Dire WolfProblem DescriptionDire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not all, Dire Wolves appear to originate from Draenor.Dire wolves look li...原创 2019-07-27 15:01:10 · 211 阅读 · 0 评论 -
HDU 6586 [2019 Multi-University Training Contest 1]
StringProblem DescriptionTom has a string containing only lowercase letters. He wants to choose a subsequence of the string whose length is k and lexicographical order is the smallest. It’s simple a...原创 2019-08-01 15:00:53 · 123 阅读 · 0 评论 -
HDU 6630 [2019 Multi-University Training Contest 5]
permutation 2Problem DescriptionYou are given three positive integers N,x,y.Please calculate how many permutations of 1∼N satisfies the following conditions (We denote the i-th number of a permutat...原创 2019-08-06 09:54:11 · 430 阅读 · 0 评论 -
HDU 6608 [2019 Multi-University Training Contest 3]
FansblogProblem DescriptionFarmer John keeps a website called ‘FansBlog’ .Everyday , there are many people visited this blog.One day, he find the visits has reached P , which is a prime number.He th...原创 2019-08-01 23:46:25 · 169 阅读 · 0 评论 -
HDU 1556
Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000)....原创 2019-04-23 18:06:03 · 133 阅读 · 0 评论