• 「POJ3537」Crosses and Crosses

    「POJ3537」Crosses and Crosses

    DescriptionThegameof CrossesandCrosses isplayedonthefieldof1× n cells.Twoplayersmakemovesinturn.Eachmovetheplayerselectsanyfreecellonthefieldandputsacross‘×’toit.Ifaftertheplayer’smovetherearethreecrossesinarow,hewins.Youaregiven n.Findoutwhowinsifbothplayersplayoptimally.InputInputfilecontainsoneintegernumber n (3≤ n ≤2000).OutputOutput‘1’ifthefirstplayerwins,or‘2’...

    02014年3月13日3,478博弈论
  • 「BZOJ1188」[HNOI2007] 分裂游戏

    「BZOJ1188」[HNOI2007] 分裂游戏

    Description聪聪和睿睿最近迷上了一款叫做分裂的游戏。该游戏的规则试:共有n个瓶子,标号为0,1,2.....n-1,第i个瓶子中装有p[i]颗巧克力豆,两个人轮流取豆子,每一轮每人选择3个瓶子。标号为i,j,k,并要保证i<j,j<=k且第i个瓶子中至少要有1颗巧克力豆,随后这个人从第i个瓶子中拿走一颗豆子并在j,k中各放入一粒豆子(j可能等于k)。如果轮到某人而他无法按规则取豆子,那么他将输掉比赛。胜利者可以拿走所有的巧克力豆!两人...

    12014年3月12日5,539博弈论
  • 「POJ3710」Christmas Game

    「POJ3710」Christmas Game

    DescriptionHarryandSallywereplayinggamesatChristmasEve.TheydrewsomeChristmastreesonapaper:Thentheytookturnstocutabranchofatree,andremovedthepartofthetreewhichhadalreadynotconnectedwiththeroot.Astepshowsasfollows:Sallyalwaysmovedfirst.Whoremovedthelastpartofthetreeswouldwinthegame.Afterawhile,theyallfiguredoutthebeststrategyandthoughtthegamewastoosimpleforthem.Harrysaid,“TheChristma...

    22014年3月12日5,230博弈论
  • 「网络流24题」分配问题

    「网络流24题」分配问题

    题目描述 Description有n件工作要分配给n个人做。第i个人做第j件工作产生的效益为ijc。试设计一个将n件工作分配给n个人做的分配方案,使产生的总效益最大。«编程任务:对于给定的n件工作和n个人,计算最优分配方案和最差分配方案。输入描述 InputDescription第1行有1个正整数n,表示有n件工作要分配给n个人做。接下来的n行中,每行有n个整数cij,1≤i≤n,1≤j≤n,表示第i个人做第j件工作产生的效益为cij输出描述 OutputD...

    02014年3月11日5,597费用流
  • 「网络流24题」负载平衡问题

    「网络流24题」负载平衡问题

    题目描述 DescriptionG公司有n个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等。如何用最少搬运量可以使n个仓库的库存数量相同。搬运货物时,只能在相邻的仓库之间搬运。«编程任务:对于给定的n个环形排列的仓库的库存量,编程计算使n个仓库的库存数量相同的最少搬运量。输入描述 InputDescription第1行中有1个正整数n(n<=100),表示有n个仓库。第2行中有n个正整数,表示n个仓库的库存量。输出描述 Outpu...

    12014年3月11日6,380费用流
  • 「POJ3480」John

    「POJ3480」John

    DescriptionLittleJohnisplayingveryfunnygamewithhisyoungerbrother.ThereisonebigboxfilledwithM&Msofdifferentcolors.AtfirstJohnhastoeatseveralM&Msofthesamecolor.Thenhisopponenthastomakeaturn.Andsoon.PleasenotethateachplayerhastoeatatleastoneM&Mduringhisturn.IfJohn(orhisbrother)willeatthelastM&Mfromtheboxhewillbeconsideredasalooserandhewillhavetobuyanewcandybox.Both...

    02014年3月11日4,578博弈论
  • 「POJ2068」Nim

    「POJ2068」Nim

    DescriptionLet'splayatraditionalgameNim.YouandIareseatedacrossatableandwehaveahundredstonesonthetable(weknowthenumberofstonesexactly).Weplayinturnandateachturn,youorIcanremoveontofourstonesfromtheheap.Youplayfirstandtheonewhoremovedthelaststoneloses.Inthisgame,youhaveawinningstrategy.Toseethis,youfirstremovefourstonesandleave96stones.NomatterhowIplay,Iwillendupwithleaving92-95stones.T...

    02014年3月11日3,959博弈论,记忆化搜索
  • 「POJ2960」S – Nim

    「POJ2960」S - Nim

    DescriptionArthurandhissisterCarollhavebeenplayingagamecalledNimforsometimenow.Nimisplayedasfollows:Thestartingpositionhasanumberofheaps,allcontainingsome,notnecessarilyequal,numberofbeads.Theplayerstaketurnschosingaheapandremovingapositivenumberofbeadsfromit.Thefirstplayernotabletomakeamove,loses.ArthurandCarollreallyenjoyedplayingthissimplegameuntiltheyrecentlylearnedaneasywaytoalwaysb...

    02014年3月11日4,765博弈论
  • 「BZOJ1227」[SDOI2009] 虔诚的墓主人

    「BZOJ1227」[SDOI2009] 虔诚的墓主人

    题目描述 Description小W是一片新造公墓的管理人。公墓可以看成一块N×M的矩形,矩形的每个格点,要么种着一棵常青树,要么是一块还没有归属的墓地。当地的居民都是非常虔诚的基督徒,他们愿意提前为自己找一块合适墓地。为了体现自己对主的真诚,他们希望自己的墓地拥有着较高的虔诚度。一块墓地的虔诚度是指以这块墓地为中心的十字架的数目。一个十字架可以看成中间是墓地,墓地的正上、正下、正左、正右都有恰好k棵常青树。...

    42014年3月11日7,556树状数组,排列组合
  • 「CF401B」Sereja and Contests

    「CF401B」Sereja and Contests

    SerejaisacoderandhelikestotakepartinCodesorfesrounds.However,Uzhlanddoesn'thavegoodinternetconnection,soSerejasometimesskipsrounds.Codesorfeshasroundsoftwotypes: Div1 (foradvancedcoders)and Div2 (forbeginnercoders).Tworounds, Div1 and Div2,cangosimultaneously,(Div1 roundcannotbeheldwithout Div2)inallothercasestheroundsdon'toverlapintime.Eachroundhasauniqueidentifier—apositi...

    02014年3月11日4,204模拟
  • 「CF401A」Vanya and Cards

    「CF401A」Vanya and Cards

    Vanyalovesplaying.Heevenhasaspecialsetofcardstoplaywith.Eachcardhasasingleinteger.Thenumberonthecardcanbepositive,negativeandcanevenbeequaltozero.Theonlylimitis,thenumberoneachcarddoesn'texceed x intheabsolutevalue.Natashadoesn'tlikewhenVanyaspendsalongtimeplaying,soshehidallofhiscards.Vanyabecamesadandstartedlookingforthecardsbutheonlyfound n ofthem.Vanyalovesthebalance,sohewantsthes...

    02014年3月11日2,287模拟
  • 「POJ2484」A Funny Game

    「POJ2484」A Funny Game

    DescriptionAliceandBobdecidetoplayafunnygame.Atthebeginningofthegametheypickn(1<=n<=106)coinsinacircle,asFigure1shows.Amoveconsistsinremovingoneortwoadjacentcoins,leavingallothercoinsuntouched.Atleastonecoinmustberemoved.PlayersalternatemoveswithAlicestarting.Theplayerthatremovesthelastcoinwins.(Thelastplayertomovewins.Ifyoucan'tmove,youlose.)Figure1Note:Forn>3,weusec1,c2,....

    02014年3月10日3,677博弈论
112 / 144 « 上一页 1 ...110 111 112 113 114 ...144 下一页 »