• NOIP2001统计单词个数

    NOIP2001统计单词个数

    题目描述Description给出一个长度不超过200的由小写英文字母组成的字母串(约定;该字串以每行20个字母的方式输入,且保证每行一定为20个)。要求将此字母串分成k份(1<k<=40),且每份中包含的单词个数加起来总数最大(每份中包含的单词可以部分重叠。当选用一个单词之后,其第一个字母不能再用。例如字符串this中可包含this和is,选用this之后就不能包含th)(管理员注:这里的不能再用指的是位置,不是字母本身。比如thisis可以...

    02014年9月22日3,216递推与动规
  • 「CF468B」Two Sets

    「CF468B」Two Sets

    LittleXhasndistinctintegers:p1, p2, ..., pn.HewantstodivideallofthemintotwosetsAandB.Thefollowingtwoconditionsmustbesatisfied:IfnumberxbelongstosetA,thennumbera - xmustalsobelongtosetA.IfnumberxbelongstosetB,thennumberb - xmustalsobelongtosetB.HelpLittleXdividethenumbersintotwosetsordeterminethatit'simpossible.InputThefirstlinecontainsthreespace-separatedintegersn, a, b(1...

    02014年9月21日3,494深度搜索
  • 「BZOJ1057」[ZJOI2007] 棋盘制作

    「BZOJ1057」[ZJOI2007] 棋盘制作

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

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

    「CFgym100486C」Text Encryption

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

    12014年9月20日2,921模拟
  • 「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,396递推与动规
  • 「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日3,062其它
  • 「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,488树形动规,图的连通
  • 「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,201递推与动规
  • 「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,996其它
  • 「CF467A」George and Accommodation

    「CF467A」George and Accommodation

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

    02014年9月19日2,574模拟
  • 「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,957link 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,561后缀自动机
62 / 144 « 上一页 1 ...60 61 62 63 64 ...144 下一页 »