ACM
pengpeng02
这个作者很懒,什么都没留下…
展开
-
【2020CCPC网络赛】1002 Graph Theory Class(HDU6889)
题目链接题意:给你一个n个结点的完全图,结点从1~n标号,结点i和j之间的边权为lcm(i+1,j+1),问你这个图的最小生成树的边权和是多少思路:为了方便起见,我们将节点从2~n+1编号,可以知道,当新加入的节点是个质数时,最小生成树的权值之和增加的是两倍的质数值,因为把这个点和2连起来是加的值最小的,当新加入节点的值不是质数时,权值之和增加的是这个数的值,因为前面一定会存在一个数是这个数的因子,只要把这个数和它的因子连起来,增加的值就只是这个数本身的值了。我们可以把所有质数提一个出来,则增加原创 2020-09-21 18:08:36 · 219 阅读 · 0 评论 -
【2020CCPC网络赛】1005 Lunch(HDU6892)
题目链接题意:有n块巧克力,每块长度为Li,两个人轮流选某一块,将其均分为x(x!=1)块,每块长度为整数。无法进行操作者输。思路:首先我们知道如果只有一块,则一定是先手必胜状态。因为先手可以把这一块分成L块长度为1的。但如果先手不是一次性分成长度为1的,那么先手是不是一定会变成必败态呢?当然不是。考虑长度为4的情况,如果将4分成2个2,最后还是先手必胜。其实,只要分成的是偶数块,都不会导致状态交换。那如果是分成奇数块呢?那就会了。比如将6分成3个2,最后先手由必胜变成了必败态。所以我们可以知道原创 2020-09-21 16:11:05 · 149 阅读 · 0 评论 -
hdu 6747 rotate 【数学期望】
http://acm.hdu.edu.cn/showproblem.php?pid=6747Problem Description我们有一个圈,从内到外一共被分成了 n 个环,中间是空的。我们把从外到内第 i 层环平分成 a[i] 份,其中 a[i] 是偶数,我们把这 a[i] 份黑白染色,第奇数个染成黑色,第偶数个染成白色。现在我们旋转每一层,每一层都会等概率随机到一个中止位置。问黑色的联通块数目的期望。两块黑色的区域有交点即算联通。层之间的旋转是相互独立的。Input第一行一个正整原创 2020-07-31 21:50:24 · 181 阅读 · 0 评论 -
Hybrid Crystals(思维,水题)
题目链接:Hybrid Crystals题意:有三种能量石,分别是L,D,N。每颗能量石含有ai的能量。能量石可以融合,融合规则:L类型的合并可以增加ai点能量,D类型的减少,N类型的可加可减(加还是减随你自己)。并且保证第一颗能量石的能量是1,且类型是N。并且每颗能量石符合题目所给的那个公式。给你一些能量石,你需要融合其中一部分,让融合后的能量是k。思路:看懂那个式子,这就是一个彻底的水题了。我直接解释式子的意义了:第一颗L的取值最大是1,第二颗最大是2,第三颗最大是4,第四颗是8。D类型的同原创 2020-06-13 18:23:42 · 135 阅读 · 0 评论 -
HDU6143 Killer Names(排列组合)
题目链接:Killer Names题意:每个人的姓和名都是长度为n的字符串,现在你有m个字符可用,要求姓和名不能出现相同的字符,问最多有多少种方案。思路:因为不要求m个字符全部用完,所以我们可以考虑共使用x个字符分配给姓和名,可选方案数是C(m,x),显然2<=x<=m。然后我们考虑从x个字符中选 i 个字符给姓,则剩下x-i个字符可以给名,可选方案数是C(x,i)。我们记 A[n][i] 是用 i 个字符填n个位置的方法数,可得状态转移方程 a[n][i]=( a[n-1][i-1]原创 2020-06-13 17:48:36 · 125 阅读 · 0 评论 -
Vertex Cover
frog has a graph with n vertices v(1),v(2),…,v(n) and m edges (v(a1),v(b1)),(v(a2),v(b2)),…,(v(am),v(bm)).She would like to color some vertices so that each edge has at least one colored vertex....原创 2019-08-14 16:52:27 · 198 阅读 · 0 评论 -
Carries
frog has n integers a1,a2,…,an, and she wants to add them pairwise.Unfortunately, frog is somehow afraid of carries (进位). She defines hardness h(x,y)for adding x and y the number of carries invo...原创 2019-08-14 16:51:10 · 247 阅读 · 0 评论 -
Censor
frog is now a editor to censor so-called sensitive words (敏感词).She has a long text p. Her job is relatively simple -- just to find the first occurence of sensitive word wand remove it.frog rep...原创 2019-08-14 15:40:18 · 384 阅读 · 0 评论 -
hdu 6026 Deleting Edges
Deleting EdgesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2224Accepted Submission(s): 742Problem DescriptionLittle Q is crazy...原创 2019-08-06 20:27:23 · 103 阅读 · 0 评论 -
hdu 6570 wave
WaveTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 733Accepted Submission(s): 315Problem DescriptionAvin is studying series. A ser...原创 2019-08-05 21:00:38 · 135 阅读 · 0 评论 -
2019 CCPC江西省赛 C HDU 6569 Trap
Avin is studying isosceles trapezoids. An isosceles trapezoid is a convex quadrilateral with two opposite parallel bases, two equal-length legs and positive area. In this problem, we further require t...原创 2019-08-05 11:28:18 · 655 阅读 · 0 评论 -
HDU 6567 Cotree(2019CCPC-江西省赛 A)
Problem DescriptionAvin has two trees which are not connected. He asks you to add an edge between them to make them connected while minimizing the function ∑ni=1∑nj=i+1dis(i,j), where dis(i,j) repre...原创 2019-08-05 11:19:46 · 254 阅读 · 0 评论 -
2019 第十六届浙江省赛部分题解
A:Vertices in the PocketDreamGrid has just found an undirected simple graph with n vertices and no edges (that's to say, it's a graph with n isolated vertices) in his right pocket, where the vertice...原创 2019-04-28 19:37:10 · 972 阅读 · 0 评论 -
黑龙江大学程序设计竞赛(重现赛)
虽然我们是打的团队赛,但我并没有做出什么贡献,貌似本人一个都没过,全程划水。全靠摊了两个好队友才A了七个出来。但赛后发现其实这些题我都是写得出的(除了F那个超时我真的没办法之外)。题目都挺简单的,但我想复杂了Problem AFind the Nth Characterhttps://ac.nowcoder.com/acm/contest/877/A题意:一个如题的字符串,求字符串中...原创 2019-04-26 19:36:50 · 364 阅读 · 0 评论