• 「CF433A」Kitahara Haruki’s Gift

    「CF433A」Kitahara Haruki's Gift

    KitaharaHarukihasbought n applesforToumaKazusaandOgisoSetsuna.Nowhewantstodividealltheapplesbetweenthefriends.Eachappleweights100gramsor200grams.OfcourseKitaharaHarukidoesn'twanttooffendanyofhisfriend.ThereforethetotalweightoftheapplesgiventoToumaKazusamustbeequaltothetotalweightoftheapplesgiventoOgisoSetsuna.ButunfortunatelyKitaharaHarukidoesn'thaveakniferightnow,sohecannotsp...

    02014年5月24日2,176模拟
  • 「CF433B」Kuriyama Mirai’s Stones

    「CF433B」Kuriyama Mirai's Stones

    KuriyamaMiraihaskilledmanymonstersandgotmany(namely n)stones.Shenumbersthestonesfrom 1 to n.Thecostofthe i-thstoneis vi.KuriyamaMiraiwantstoknowsomethingaboutthesestonessoshewillaskyoutwokindsofquestions:Shewilltellyoutwonumbers, l and r (1 ≤ l ≤ r ≤ n),andyoushouldtellher .Let ui bethecostofthe i-thcheapeststone(thecostthatwillbeonthe i-thplaceifwearrangealltheston...

    02014年5月24日2,853模拟
  • 「BZOJ1629」[Usaco2007 Demo] Cow Acrobats

    「BZOJ1629」[Usaco2007 Demo] Cow Acrobats

    DescriptionFarmerJohn'sN(1<=N<=50,000)cows(numbered1..N)areplanningtorunawayandjointhecircus.Theirhoofedfeetpreventthemfromtightropewalkingandswingingfromthetrapeze(andtheirlastattemptatfiringacowoutofacannonmetwithadismalfailure).Thus,theyhavedecidedtopracticeperformingacrobaticstunts.Thecowsaren'tterriblycreativeandhaveonlycomeupwithoneacrobaticstunt:standingontopofeachothertoform...

    02014年5月23日3,632贪心
  • 「BZOJ1336 / 1337」[Balkan2002] Alien最小圆覆盖

    「BZOJ1336 / 1337」[Balkan2002] Alien最小圆覆盖

    Description给出N个点,让你画一个最小的包含所有点的圆。Input先给出点的个数N,2<=N<=100000,再给出坐标Xi,Yi.(-10000.0<=xi,yi<=10000.0)Output输出圆的半径,及圆心的坐标SampleInput68.09.04.07.51.02.05.18.79.02.04.51.0 SampleOutput5.005.005.00HINT用传说中的随机增量法,请自行百度[crayon-67a584ce0c128490237795/] ...

    12014年5月22日4,502随机化
  • 「CF431B」Shower Line

    「CF431B」Shower Line

    Manystudentsliveinadormitory.Adormitoryisawholenewworldoffunnyamusementsandpossibilitiesbutitdoeshaveitsdrawbacks.Thereisonlyoneshowerandtherearemultiplestudentswhowishtohaveashowerinthemorning.That'swhyeverymorningthereisalineoffivepeopleinfrontofthedormitoryshowerdoor.Assoonastheshoweropens,thefirstpersonfromthelineenterstheshower.Afterawhilethefirstpersonleavestheshowerandthenextpersonent...

    02014年5月22日2,916模拟,深度搜索
  • 「CF431A」Black Square

    「CF431A」Black Square

    Quiterecently,averysmartstudentnamedJurydecidedthatlecturesareboring,sohedownloadedagamecalled"BlackSquare"onhissupercooltouchscreenphone.Inthisgame,thephone'sscreenisdividedintofourverticalstrips.Eachsecond,ablacksquareappearsonsomeofthestrips.Accordingtotherulesofthegame,Jurymustusethissecondtotouchthecorrespondingstriptomakethesquaregoaway.AsJuryisbothsmartandlazy,hecountedthathewaste...

    02014年5月22日2,464模拟
  • 「432C」Prime Swaps

    「432C」Prime Swaps

    Youhaveanarray a[1], a[2], ..., a[n],containingdistinctintegersfrom 1 to n.Yourtaskistosortthisarrayinincreasingorderwiththefollowingoperation(youmayneedtoapplyitmultipletimes):choosetwoindexes, i and j (1 ≤ i < j ≤ n; (j - i + 1) isaprimenumber);swaptheelementsonpositions i and j;inotherwords,youareallowedtoapplythefollowingsequenceofassignments: tmp = a[i], a...

    02014年5月21日2,914贪心,筛法
  • 「JoyOI1040」表达式计算

    「JoyOI1040」表达式计算

    题目描述给出一个表达式,其中运算符仅包含+,要求求出表达式的最终值输入仅一行,即为表达式输出仅一行,既为表达式算出的结果样例输入1+1样例输出2提示 表达式总长度<=1500 代码2013.12.21[crayon-67a584ce0d558887324134/]2014.5.20有学弟一直纠结这个就重写了一次没写函数的。。发现代码风格变化很大[crayon-67a584ce0d562981639039/]  ...

    12014年5月20日938高精度
  • 「BZOJ1717」[Usaco2006 Dec] Milk Patterns 产奶的模式

    「BZOJ1717」[Usaco2006 Dec] Milk Patterns 产奶的模式

    Description农夫John发现他的奶牛产奶的质量一直在变动。经过细致的调查,他发现:虽然他不能预见明天产奶的质量,但连续的若干天的质量有很多重叠。我们称之为一个“模式”。John的牛奶按质量可以被赋予一个0到1000000之间的数。并且John记录了N(1<=N<=20000)天的牛奶质量值。他想知道最长的出现了至少K(2<=K<=N)次的模式的长度。比如12323231中2323出现了两次。当K=2时,这个长度为4。Input*Line1:两个整...

    52014年5月20日6,136二分法,后缀数组
  • 「BZOJ1827」[Usaco2010 Mar] gather 奶牛大集会

    「BZOJ1827」[Usaco2010 Mar] gather 奶牛大集会

    DescriptionBessie正在计划一年一度的奶牛大集会,来自全国各地的奶牛将来参加这一次集会。当然,她会选择最方便的地点来举办这次集会。每个奶牛居住在N(1<=N<=100,000)个农场中的一个,这些农场由N-1条道路连接,并且从任意一个农场都能够到达另外一个农场。道路i连接农场A_i和B_i(1<=A_i<=N;1<=B_i<=N),长度为L_i(1<=L_i<=1,000)。集会可以在N个农场中的任意一个举行。另外,每个牛棚中居...

    02014年5月19日4,247贪心,树形动规
  • 「BZOJ1876」[SDOI2009] SuperGCD

    「BZOJ1876」[SDOI2009] SuperGCD

    DescriptionShengbill有着惊人的心算能力,甚至能用大脑计算出两个巨大的数的GCD(最大公约数)!因此他经常和别人比赛计算GCD。有一天Shengbill很嚣张地找到了你,并要求和你比赛,但是输给Shengbill岂不是很丢脸!所以你决定写一个程序来教训他。Input共两行:第一行:一个数A。第二行:一个数B。Output一行,表示A和B的最大公约数。SampleInput1254SampleOutput6HINT对于20%的数据,0<A,B≤10^18。...

  • 「BZOJ1755」[Usaco2005 qua] Bank Interest

    「BZOJ1755」[Usaco2005 qua] Bank Interest

    DescriptionFarmerJohnmadeaprofitlastyear!Hewouldliketoinvestitwellbutwondershowmuchmoneyhewillmake.HeknowstheinterestrateR(anintegerbetween0and20)thatiscompoundedannuallyathisbank.HehasanintegeramountofmoneyMintherange100..1,000,000.HeknowshowmanyyearsY(range:0..400)heintendstoinvestthemoneyinthebank.Helphimlearnhowmuchmoneyhewillhaveinthefuturebycompoundingtheinterestforeachyearhesaves...

    02014年5月14日2,685模拟
27 / 41 « 上一页 1 ...25 26 27 28 29 ...41 下一页 »