• 「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日3,487模拟
  • 「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日1,997模拟
  • 「BZOJ1189」[HNOI2007] 紧急疏散evacuate

    「BZOJ1189」[HNOI2007] 紧急疏散evacuate

     Description发生了火警,所有人员需要紧急疏散!假设每个房间是一个NM的矩形区域。每个格子如果是'.',那么表示这是一块空地;如果是'X',那么表示这是一面墙,如果是'D',那么表示这是一扇门,人们可以从这儿撤出房间。已知门一定在房间的边界上,并且边界上不会有空地。最初,每块空地上都有一个人,在疏散的时候,每一秒钟每个人都可以向上下左右四个方向移动一格,当然他也可以站着不动。疏散开始后,每块空地上就没...

    62014年3月7日6,855最大流,二分法,广度搜索
  • 归并排序

    归并排序

    学了一下归并排序[crayon-662d516b60222595617408/] 

    02014年3月6日2,544模拟
  • 「CF400B」Inna and New Matrix of Candies

    「CF400B」Inna and New Matrix of Candies

    Innalikessweetsandagamecalledthe"CandyMatrix".Today,shecameupwiththenewgame"CandyMatrix2:Reload".Thefieldforthenewgameisarectangletableofsize n × m.Eachlineofthetablecontainsonecellwithadwarffigurine,onecellwithacandy,theothercellsofthelineareempty.Thegamelastsforseveralmoves.Duringeachmovetheplayercanchoose alllinesofthematrixwheredwarfisnotonthecellwithcandy andshout"Let'sgo!"....

    02014年3月6日2,074模拟
  • 「CF400A」Inna and Choose Options

    「CF400A」Inna and Choose Options

    Therealwaysissomethingtochoosefrom!Andnow,insteadof"NoughtsandCrosses",Innachooseaveryunusualupgradeofthisgame.Therulesofthegamearegivenbelow:Thereisonepersonplayingthegame.Beforethebeginningofthegameheputs12cardsinarowonthetable.Eachcardcontainsacharacter:"X"or"O".Thentheplayerchoosestwopositiveintegers a and b (a·b = 12),afterthathemakesatableofsize a × b fromthecardshepu...

    02014年3月6日2,623模拟
  • 「CF399B」Red and Blue Balls

    「CF399B」Red and Blue Balls

    Useraintahasastackof n redandblueballs.Hecanapplyacertainoperationwhichchangesthecolorsoftheballsinsidethestack.Whilethetopballinsidethestackisred,poptheballfromthetopofthestack.Thenreplacetheblueballonthetopwitharedball.Andfinallypushsomeblueballstothestackuntilthestackhastotalof n ballsinside.Iftherearenoblueballsinsidethestack,aintacan'tapplythisoperation.Giventheinitialstateofthesta...

    02014年3月2日3,974模拟
  • 「CF399A」Pages

    「CF399A」Pages

    Useraintaismakingawebsite.Thistimeheisgoingtomakeanavigationofthepages.Inhissite,thereare n pagesnumberedbyintegersfrom 1 to n.Assumethatsomebodyisonthe p-thpagenow.Thenavigationwilllooklikethis:  << p - k p - k + 1 ... p - 1 (p) p + 1 ... p + k - 1 p + k >>Whensomeoneclicksthebutton"<<"heisredirectedtopage 1,andwhensomeoneclicksth...

    02014年3月2日2,231模拟
  • 「CF397A」On Segment’s Own POInts

    「CF397A」On Segment's Own POInts

    OuroldfriendAlexeyhasfinallyenteredtheUniversityofCityN—theBerlandcapital.AlexeyexpectedhisfathertogethimaplacetoliveinbuthisfathersaiditwashightimeforAlexeytopracticesomefinancialindependence.So,Alexeyislivinginadorm.Thedormhasexactlyonestraightdryer—a 100 centimeterlongropetohangclotheson.Thedryerhasgotacoordinatesysteminstalled:theleftmostendofthedryerhascoordinate 0,andtheoppo...

    02014年3月1日2,273模拟
  • 「BZOJ1614」[Usaco2007 Jan] Telephone Lines架设电话线

    「BZOJ1614」[Usaco2007 Jan] Telephone Lines架设电话线

    题目描述FarmerJohn打算将电话线引到自己的农场,但电信公司并不打算为他提供免费服务。于是,FJ必须为此向电信公司支付一定的费用。   FJ的农场周围分布着N(1<=N<=1,000)根按1..N顺次编号的废弃的电话线杆,任意两根电话线杆间都没有电话线相连。一共P(1<=P<=10,000)对电话线杆间可以拉电话线,其余的那些由于隔得太远而无法被连接。    第i对电话线杆的两个端点分别为A_i、B_i,它们间的距离为L...

    32014年3月1日6,023spfa,二分法
  • 「fjWC2014」猜数字

    「fjWC2014」猜数字

    DescriptionK国在胖哥的英明统治下,近来迷上了一款非常脑残的游戏,叫做猜数字,这个游戏是一个二人游戏,胖哥认为它非常有利于促进两个人之间的感情,假设玩家A和玩家B进行这个游戏,首先他们会确定一个正整数n,然后A从1-n中选定一个整数,注意一旦选定之后只有游戏结束都不能修改这个数字,假设这个数字是x,然后游戏开始,每次B都可以在1-n中选择一个整数,假设这个数字是y,然后A会告诉他gcd(x,y)的值,即x和y的最大公...

    02014年2月16日3,319贪心
  • 「usaco chapter」混合牛奶

    「usaco chapter」混合牛奶

    题目描述牛奶包装是一个如此低利润的生意,所以尽可能低的控制初级产品(牛奶)的价格变的十分重要。请帮助快乐的牛奶制造者(MerryMilkMakers)以可能的最廉价的方式取得他们所需的牛奶。快乐的牛奶制造公司从一些农民那购买牛奶,每个农民卖给牛奶制造公司的价格不一定相同。而且,如一只母牛一天只能生产一定量的牛奶,农民每一天只有一定量的牛奶可以卖。每天,快乐的牛奶制造者从每个农民那购买一定量的牛奶,少于或等于农民所能提供...

    02014年2月13日2,448贪心
33 / 41 « 上一页 1 ...31 32 33 34 35 ...41 下一页 »