• 「JoyOI1864」[Poetize I] 守卫者的挑战

    「JoyOI1864」[Poetize I] 守卫者的挑战

    描述Description  打开了黑魔法师Vani的大门,队员们在迷宫般的路上漫无目的地搜寻着关押applepi的监狱的所在地。突然,眼前一道亮光闪过。“我,Nizem,是黑魔法圣殿的守卫者。如果你能通过我的挑战,那么你可以带走黑魔法圣殿的地图……”瞬间,队员们被传送到了一个擂台上,最初身边有一个容量为K的包包。擂台赛一共有N项挑战,各项挑战依次进行。第i项挑战有一个属性ai,如果ai>=0,表示这次挑战成功后可以再获得一个...

    62014年8月27日3,900递推与动规,概率与期望
  • 「CF459E」Pashmak and Graph

    「CF459E」Pashmak and Graph

    Pashmak'shomeworkisaproblemaboutgraphs.Althoughhealwaystriestodohishomeworkcompletely,hecan'tsolvethisproblem.Asyouknow,he'sreallyweakatgraphtheory;sotrytohelphiminsolvingtheproblem.Youaregivenaweighteddirectedgraphwith n verticesand m edges.Youneedtofindapath(perhaps,non-simple)withmaximumnumberofedges,suchthattheweightsoftheedgesincreasealongthepath.Inotherwords,eachedgeofthepathmustha...

    02014年8月20日2,558递推与动规
  • 「NOIP模拟赛by wulala」公主的工作

    「NOIP模拟赛by wulala」公主的工作

    和bzoj1046并没多大差别吧。。。[crayon-664476dfde857217891185/] 

    02014年8月16日2,727递推与动规,贪心
  • 「BZOJ1046」[HAOI2007] 上升序列

    「BZOJ1046」[HAOI2007] 上升序列

    Description对于一个给定的S={a1,a2,a3,…,an},若有P={ax1,ax2,ax3,…,axm},满足(x1<x2<…<xm)且(ax1<ax2<…<axm)。那么就称P为S的一个上升序列。如果有多个P满足条件,那么我们想求字典序最小的那个。任务给出S序列,给出若干询问。对于第i个询问,求出长度为Li的上升序列,如有多个,求出字典序最小的那个(即首先x1最小,如果不唯一,再看x2最小……),如果不存在长度为Li的上升序列,则打印Impo...

    32014年8月15日7,407递推与动规,贪心
  • 「CF455A」Boredom

    「CF455A」Boredom

    Alexdoesn'tlikeboredom.That'swhywheneverhegetsbored,hecomesupwithgames.Onelongwintereveninghecameupwithagameanddecidedtoplayit.Givenasequence a consistingof n integers.Theplayercanmakeseveralsteps.Inasinglestephecanchooseanelementofthesequence(let'sdenoteit ak)anddeleteit,atthatallelementsequalto ak + 1 and ak - 1 alsomustbedeletedfromthesequence.Thatstepbrings ak pointstothe...

    02014年8月12日2,725递推与动规
  • 「CF453B」Little Pony and Harmony Chest

    「CF453B」Little Pony and Harmony Chest

    PrincessTwilightwenttoCelestiaandLuna'soldcastletoresearchthechestfromtheElementsofHarmony.Asequenceofpositiveintegers bi isharmonyifandonlyifforeverytwoelementsofthesequencetheirgreatestcommondivisorequals1.Accordingtoanancientbook,thekeyofthechestisaharmonysequence bi whichminimizesthefollowingexpression:Youaregivensequence ai,helpPrincessTwilighttofindthekey.InputThefirstlinec...

    02014年8月2日3,540递推与动规,状压动规
  • 「BZOJ1584」[Usaco2009 Mar] Cleaning Up 打扫卫生

    「BZOJ1584」[Usaco2009 Mar] Cleaning Up 打扫卫生

    Description有N头奶牛,每头那牛都有一个标号Pi,1<=Pi<=M<=N<=40000。现在FarmerJohn要把这些奶牛分成若干段,定义每段的不河蟹度为:若这段里有k个不同的数,那不河蟹度为k*k。那总的不河蟹度就是所有段的不河蟹度的总和。Input第一行:两个整数N,M第2..N+1行:N个整数代表每个奶牛的编号Output一个整数,代表最小不河蟹度SampleInput1341213223434314SampleOutput11题解不会做TT看了半天题解这...

    12014年7月30日4,184递推与动规
  • 「BZOJ1710」[Usaco2007 Open] Cheappal 廉价回文

    「BZOJ1710」[Usaco2007 Open] Cheappal 廉价回文

    Description为了跟踪所有的牛,农夫JOHN在农场上装了一套自动系统.他给了每一个头牛一个电子牌号当牛走过这个系统时,牛的名字将被自动读入.每一头牛的电子名字是一个长度为M(1<=M<=2,000)由N(1<=N<=26)个不同字母构成的字符串.很快,淘气的牛找到了系统的漏洞:它们可以倒着走过读码器.一头名字为"abcba"不会导致任何问题,但是名为"abcb"的牛会变成两头牛("abcb"和"bcba").农夫JOHN想改变牛的名字,使得牛的名...

    02014年7月29日3,202递推与动规
  • 「BZOJ2101」[Usaco2010 Dec] Treasure Chest 藏宝箱

    「BZOJ2101」[Usaco2010 Dec] Treasure Chest 藏宝箱

    DescriptionBessieandBonniehavefoundatreasurechestfullofmarvelousgoldcoins!Beingcows,though,theycan'tjustwalkintoastoreandbuystuff,soinsteadtheydecidetohavesomefunwiththecoins.TheN(1<=N<=5,000)coins,eachwithsomevalueC_i(1<=C_i<=5,000)areplacedinastraightline.BessieandBonnietaketurns,andforeachcow'sturn,shetakesexactlyonecoinoffofeithertheleftendortherightendoftheline.Thegame...

    02014年7月28日3,369递推与动规
  • 「BZOJ1672」[Usaco2005 Dec] Cleaning Shifts 清理牛棚

    「BZOJ1672」[Usaco2005 Dec] Cleaning Shifts 清理牛棚

    DescriptionFarmerJohn'scows,pamperedsincebirth,havereachednewheightsoffastidiousness.Theynowrequiretheirbarntobeimmaculate.FarmerJohn,themostobligingoffarmers,hasnochoicebuthiresomeofthecowstocleanthebarn.FarmerJohnhasN(1<=N<=10,000)cowswhoarewillingtodosomecleaning.Becausedustfallscontinuously,thecowsrequirethatthefarmbecontinuouslycleanedduringtheworkday,whichrunsfromsecondnumbe...

    02014年7月28日4,929递推与动规,线段树
  • 「BZOJ1664」[Usaco2006 Open] County Fair Events 参加节日庆祝

    「BZOJ1664」[Usaco2006 Open] County Fair Events 参加节日庆祝

    DescriptionFarmerJohnhasreturnedtotheCountyFairsohecanattendthespecialevents(concerts,rodeos,cookingshows,etc.).HewantstoattendasmanyoftheN(1<=N<=10,000)specialeventsashepossiblycan.He'srentedabicyclesohecanspeedfromoneeventtothenextinabsolutelynotimeatall(0timeunitstogofromoneeventtothenext!).GivenalistoftheeventsthatFJmightwishtoattend,withtheirstarttimes(1<=T<=100,000)a...

    02014年7月28日3,397递推与动规
  • 「CF452D」Washer, Dryer, Folder

    「CF452D」Washer, Dryer, Folder

    Youhave k piecesoflaundry,eachofwhichyouwanttowash,dryandfold.Youareatalaundromatthathas n1 washingmachines,n2 dryingmachinesand n3 foldingmachines.Eachmachinecanprocessonlyonepieceoflaundryatatime.Youcan'tdryapieceoflaundrybeforeitiswashed,andyoucan'tfolditbeforeitisdried.Moreover,afterapieceoflaundryiswashed,itneedstobeimmediatelymovedintoadryingmachine,andafteritisdried,itneedstobei...

    02014年7月28日3,100递推与动规
10 / 18 « 上一页 1 ...8 9 10 11 12 ...18 下一页 »