• 「BZOJ1057」[ZJOI2007] 棋盘制作

    「BZOJ1057」[ZJOI2007] 棋盘制作

    Description国际象棋是世界上最古老的博弈游戏之一,和中国的围棋、象棋以及日本的将棋同享盛名。据说国际象棋起源于易经的思想,棋盘是一个8*8大小的黑白相间的方阵,对应八八六十四卦,黑白对应阴阳。而我们的主人公小Q,正是国际象棋的狂热爱好者。作为一个顶尖高手,他已不满足于普通的棋盘与规则,于是他跟他的好朋友小W决定将棋盘扩大以适应他们的新规则。小Q找到了一张由N*M个正方形的格子组成的矩形纸片,每个格子被...

    02014年9月20日4,502递推与动规
  • 「CFgym100486C」Text Encryption

    「CFgym100486C」Text Encryption

    Tokeepprivacyofmessagesandpreventthealiensfromreadingthem,wemayusevariousencryptionalgorithms.Thesealgorithmsencodeamessageintotheso-calledciphertextthatisdifficult(orimpossible)todecodeforanyoneelsethantheintendedrecipient.Transpositionciphersareatypeofencryptionthatdonotchangethelettersofthemessagebutonlychangetheirorder(“shuffle”theletters).Ofcourse,theshufflingmustbereversibletoallowlate...

    12014年9月20日2,848模拟
  • 「CFgym100486J」 Saving the Universe

    「CFgym100486J」 Saving the Universe

    heurbanlegendgoesthatifyougototheGooglehomepageandsearchforGoogle,theuniversewillimplode.Wehaveasecrettoshare...Itistrue!Pleasedon'ttryit,ortellanyone.Allright,maybenot.WearejustkiddingThesameisnottrueforauniversefarfaraway.Inthatuniverse,ifyousearchonanysearchengineforthatsearchengine'sname,theuniversedoesimplode!Tocombatthis,peoplecameupwithaninterestingsolution.Allqueriesarepooledt...

    02014年9月20日2,333递推与动规
  • 「BZOJ2102」[Usaco2010 Dec] The Trough Game

    「BZOJ2102」[Usaco2010 Dec] The Trough Game

    DescriptionFarmerJohnandBessieareplayinggamesagain.Thisonehastodowithtroughsofwater.FarmerJohnhashiddenN(1<=N<=20)troughsbehindthebarn,andhasfilledsomeofthemwithfood.BessiehasaskedM(1<=M<=100)questionsoftheform,"Howmanytroughsfromthislist(whichsherecites)arefilled?".Bessieneedsyourhelptodeducewhichtroughsareactuallyfilled.ConsideranexamplewithfourtroughswhereBessiehasas...

    02014年9月19日2,966其它
  • 「CF467D」Fedor and Essay

    「CF467D」Fedor and Essay

    AfteryouhadhelpedFedortofindfriendsinthe«CallofSoldiers3»game,hestoppedstudyingcompletely.Today,theEnglishteachertoldhimtoprepareanessay.Fedordidn'twanttopreparetheessay,soheaskedAlexforhelp.AlexcametohelpandwrotetheessayforFedor.ButFedordidn'tliketheessayatall.NowFedorisgoingtochangetheessayusingthesynonymdictionaryoftheEnglishlanguage.Fedordoesnotwanttochangethemeaningoftheessa...

    02014年9月19日3,357树形动规,图的连通
  • 「CF467C」George and Job

    「CF467C」George and Job

    ThenewITone6hasbeenreleasedrecentlyandGeorgegotreallykeentobuyit.Unfortunately,hedidn'thaveenoughmoney,soGeorgewasgoingtoworkasaprogrammer.Nowhefacedthefollowingproblematthework.Givenasequenceofnintegersp1, p2, ..., pn.Youaretochoosekpairsofintegers:[l1, r1], [l2, r2], ..., [lk, rk] (1 ≤ l1 ≤ r1 < l2 ≤ r2 < ... < lk ≤ rk ≤ n; ri - li + 1 = m)...

    12014年9月19日4,122递推与动规
  • 「CF467B」Fedor and New Game

    「CF467B」Fedor and New Game

    AfteryouhadhelpedGeorgeandAlextomoveinthedorm,theywenttohelptheirfriendFedorplayanewcomputergame«CallofSoldiers3».Thegamehas(m + 1)playersandntypesofsoldiersintotal.Players«CallofSoldiers3»arenumberedform1to(m + 1).Typesofsoldiersarenumberedfrom0ton - 1.Eachplayerhasanarmy.Armyofthei-thplayercanbedescribedbynon-negativeintegerxi.Considerbinaryrepresentationofxi:ifthej-thbit...

    02014年9月19日2,911其它
  • 「CF467A」George and Accommodation

    「CF467A」George and Accommodation

    GeorgehasrecentlyenteredtheBSUCP(BerlandStateUniversityforCoolProgrammers).GeorgehasafriendAlexwhohasalsoenteredtheuniversity.Nowtheyaremovingintoadormitory.GeorgeandAlexwanttoliveinthesameroom.Thedormitoryhasnroomsintotal.Atthemomentthei-throomhaspipeoplelivinginitandtheroomcanaccommodateqipeopleintotal(pi ≤ qi).YourtaskistocounthowmanyroomshasfreeplaceforbothGeorgeandAlex...

    02014年9月19日2,518模拟
  • 「BZOJ3282」Tree

    「BZOJ3282」Tree

    Description给定N个点以及每个点的权值,要你处理接下来的M个操作。操作有4种。操作从0到3编号。点从1到N编号。0:后接两个整数(x,y),代表询问从x到y的路径上的点的权值的xor和。保证x到y是联通的。1:后接两个整数(x,y),代表连接x到y,若x到Y已经联通则无需连接。2:后接两个整数(x,y),代表删除边(x,y),不保证边(x,y)存在。3:后接两个整数(x,y),代表将点X上的权值变...

    22014年9月18日5,826link cut tree
  • 「SPOJ8222」Substrings

    「SPOJ8222」Substrings

    YouaregivenastringSwhichconsistsof250000lowercaselatinlettersatmost.WedefineF(x)asthemaximalnumberoftimesthatsomestringwithlengthxappearsinS.Forexampleforstring'ababa'F(3)willbe2becausethereisastring'aba'thatoccurstwice.YourtaskistooutputF(i)foreveryisothat1<=i<=|S|.InputStringSconsistsofatmost250000lowercaselatinletters.OutputOutput|S|lines.Onthei-thlineoutputF(i).Example...

    72014年9月17日6,424后缀自动机
  • 「POJ2774」Long Long Message

    「POJ2774」Long Long Message

    DescriptionThelittlecatismajoringinphysicsinthecapitalofByterland.Apieceofsadnewscomestohimthesedays:hismotherisgettingill.Beingworriedaboutspendingsomuchonrailwaytickets(Byterlandissuchabigcountry,andhehastospend16shoursontraintohishometown),hedecidedonlytosendSMSwithhismother.Thelittlecatlivesinanunrichfamily,sohefrequentlycomestothemobileservicecenter,tocheckhowmuchmoneyhehasspentonS...

    02014年9月15日5,298后缀数组
  • 「BZOJ1271」[BJWc2008] 秦腾与教学评估

    「BZOJ1271」[BJWc2008] 秦腾与教学评估

    DescriptionInputOutputSampleInputSampleOutputHINT题解因为只有最多一个位置是奇数在这个位置后前缀和都是奇数可以二分+前缀和找出这个位置[crayon-67ac89db76cf5256726747/]  ...

    02014年9月14日3,120二分法
63 / 145 « 上一页 1 ...61 62 63 64 65 ...145 下一页 »