• 等级
  • 131591 访问
  • 696 原创
  • 15 转发
  • 4320 排名
  • 54 评论
  • 59 获赞

L2-028 秀恩爱分得快 (25 point(s))

古人云:秀恩爱,分得快。互联网上每天都有大量人发布大量照片,我们通过分析这些照片,可以分析人与人之间的亲密度。如果一张照片上出现了K个人,这些人两两间的亲密度就被定义为1/K。任意两个人如果同时出现在若干张照片里,他们之间的亲密度就是所有这些同框照片对应的亲密度之和。下面给定一批照片,请你分析一对给定的情侣,看看他们分别有没有亲密度更高的异性朋友?输入格式:输入在第一行给出2个正整...

2019-03-10 12:40:55

Monthly Expense(二分)

MonthlyExpenseFarmerJohnisanastoundingaccountingwizardandhasrealizedhemightrunoutofmoneytorunthefarm.Hehasalreadycalculatedandrecordedtheexactamountofmoney(1≤moneyi...

2018-10-15 11:23:15

Instability HDU - 5917(Ramsey定理)

InstabilityHDU-5917Longlongago,therewasaprosperouskingdomwhichconsistedofncitiesandeverytwociteswereconnectedbyanundirectedroad.However,onedayabigmonsterattackedthek...

2018-09-25 17:11:25

K-th Number HDU - 6231(二分+尺取)

K-thNumberHDU-6231AlicearegivenanarrayA[1…N]withNnumbers.NowAlicewanttobuildanarrayBbyaparameterKasfollowingrules:Initially,thearrayBisempty.Considereachintervali...

2018-09-24 11:02:57

A Simple Stone Game HDU - 6237(分解质因子+思维)

ASimpleStoneGameHDU-6237AfterhehaslearnedhowtoplayNimgame,Bobbeginstotryanotherstonegamewhichseemsmucheasier.Thegamegoeslikethis:oneplayerstartsthegamewithNpiles...

2018-09-24 07:57:01

Expressions UVA - 10157(组合数学+递推)

ExpressionsUVA-10157题目:给你n个括号,求合法的匹配中,深度不超过d的组合数。分析:组合,计数,dp,大整数。这个题目很像卡特兰数,不过深度有限制,可以利用卡特兰数的递推公式求解;设DP(k,d)为k对括号形成深度不超过d的合法匹配方法数;则有:DP(k,d)=Σ(DP(i,d-1)*DP(k-1-i,d)){i取0到k-1}(按卡特兰数递推,...

2018-09-23 09:09:10

Counting UVA - 10198(线性递推式)

CountingUVA-10198题意:Gustavo数数时总是把1和4搞混,他认为4只是1的另外一种写法。给出一个整数n,Gustavo想知道有多少个数的数字之和恰好为n。例如,当n=2时,有5个数:11、14、41、44、2。分析:设dp[n]表示加和为n的组合的个数那么很明显这些组合中应该含有含1的组合,那么去掉这个1的话就是dp[n-1]的个数加上一个1,同理含2的话有d...

2018-09-22 09:33:02

Sum HDU - 4407(容斥定理)

SumHDU-4407XXXispuzzledwiththequestionbelow:1,2,3,…,n(1<=n<=400000)areplacedinaline.Therearem(1<=m<=1000)operationsoftwokinds.Operation1:amongthex-thnumb...

2018-09-21 13:30:04

Balloon Robot ZOJ - 3981(思维)

BalloonRobotZOJ-3981The2017ChinaCollegiateProgrammingContestQinhuangdaoSiteiscoming!Therewillbeteamsparticipatinginthecontest,andthecontestwillbeheldonahugeroundtable...

2018-09-21 10:23:14

Safest Buildings ZOJ - 3993(计算几何+思维)

SafestBuildingsZOJ-3993PUBGisamultiplayeronlinebattleroyalevideogame.Inthegame,uptoonehundredplayersparachuteontoanislandandscavengeforweaponsandequipmenttokillothers...

2018-09-21 07:42:55

Numbers ZOJ - 3987(二进制思维+贪心)

NumbersZOJ-3987DreamGridhasanonnegativeinteger.Hewouldliketodivideintononnegativeintegersandminimizestheirbitwiseor(i.e.andshouldbeassmallaspossible).InputTherearemul...

2018-09-19 12:07:08

Crusaders Quest ZOJ - 3983(思维+暴力)

CrusadersQuestZOJ-3983CrusadersQuestisaninterestingmobilegame.Amysteriouswitchhasbroughtgreatdarknesstothegameworld,andtheonlyhopeforyourkingdomistosavetheGoddessess...

2018-09-19 07:40:59

Uva12230Crossing Rivers (数学期望)

Uva12230CrossingRivers(数学期望)问题:Youliveinavillagebutworkinanothervillage.Youdecidedtofollowthestraightpathbetweenyourhouse(A)andtheworkingplace(B),butthereareseveralri...

2018-09-18 11:13:19

ACM-ICPC 2018 焦作网络预赛K-Transport Ship(多重背包)

ACM-ICPC2018焦作网络预赛K-TransportShipThereareNNNdifferentkindsoftransportshipsontheport.Theithi^{th}ithkindofshipcancarrytheweightofV[i]V[i]V[i]andthenumberoftheithi^{th}it...

2018-09-16 10:29:03

ACM-ICPC 2018 焦作网络预赛 B - Mathematical Curse(dp)

ACM-ICPC2018焦作网络预赛B-MathematicalCurseAprinceoftheScienceContinentwasimprisonedinacastlebecauseofhiscontemptformathematicswhenhewasyoung,andwasentangledinsomemathemati...

2018-09-16 08:45:57

Computer HDU - 2196(树形DP)

ComputerHDU-2196Aschoolboughtthefirstcomputersometimeago(sothiscomputer’sidis1).DuringtherecentyearstheschoolboughtN-1newcomputers.Eachnewcomputerwasconnectedtooneo...

2018-09-15 09:53:37

Puzzled Elena HDU - 5468(dfs序+容斥定理)

PuzzledElenaHDU-5468SincebothStefanandDamonfellinlovewithElena,anditwasreallydifficultforhertochoose.Bonnie,herbestfriend,suggestedhertothrowaquestiontothem,ands...

2018-09-14 19:56:12

Stern-Brocot Tree HDU - 4556(法里数列长度)

Stern-BrocotTreeHDU-4556 上图是一棵Stern-Brocot树,其生成规则如下:  从第1行到第n行,每行相邻两数a/b和c/d,产生中间数(a+c)/(b+d),置于下一行中。将一行的分数(包括0/1,1/0),进行约分简化,则每一行(包括0/1,1/0,1/1),不会出现两个相同的分数。若分子或者分母大于n,则去掉该分数,将剩下的分数,从小到大排序,得...

2018-09-14 15:54:46

Pythagoras HDU - 6211(法里数列构造+本原勾股数组+本地预处理不出来。。)

PythagorasHDU-6211Givenalistofintegersa0,a1,a2,⋯,a2k−1.Pythagorastriplesover109areallsolutionsofx2+y2=z2wherex,yandzareconstrainedtobepositiveintegerslessthanorequalt...

2018-09-14 15:08:43

Zuma HDU - 6212(区间dp)

ZumaHDU-6212ThinkabouttheZumaGame.Youhavearowofatmost200black(0)orwhite(1)ballsonthetableatthestart.Eachthreeconsecutiveballsneversharethesamecolour.Youalso...

2018-09-14 09:44:45

一只二十四节气

Time is choice. being a knowledgeable person 退役
关注
  • 计算机软件/大学生
  • 中国 山东省 济南市
奖章
  • 持之以恒