Youaregivenanencryptedstring,encryptedusingacertainalgorithm.Decryptit!InputThefirstandonlylineofinputcontainsastrings,eachcharacterofsiseither0or1.(8 ≤ |s| ≤ 8 × 104)OutputPrinttheoriginalstring.Sampletest(s)input[crayon-676876633a7e9110525005/]output[crayon-676876633a7f1657476361/]input[crayon-676876633a7f4728076194/]output[crayon-676876633a7f7027148814/]input[crayon-676876633a7f...
Youaregivenanencryptedstring,encryptedusingacertainalgorithm.Decryptit!InputThefirstandsinglelineofinputcontainsastrings,whicheachofit'scharactersisalowercaseEnglishletter.(1 ≤ |s| ≤ 105)OutputPrinttheoriginalstring.Sampletest(s)input[crayon-676876633ac36916047951/]output[crayon-676876633ac3e687270641/]input[crayon-676876633ac42339901518/]output[crayon-676876633ac44942688221/]input[c...
PolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievgotholdoflotsofwoodencubessomewhere.Theystartedmakingcubetowersbyplacingthecubesoneontopoftheother.Theydefinedmultipletowersstandinginalineasawall.Awallcanconsistoftowersofdifferentheights.Horacewasthefirsttofinishmakinghiswall.Hecalledhiswallanelephant.Thewallconsistsofwtowers.Thebearsalsofinishedm...
LittleDaniellovestoplaywithstrings!Healwaysfindsdifferentwaystohavefunwithstrings!Knowingthat,hisfriendKinandecidedtotesthisskillssohegavehimastringSandaskedhimQquestionsoftheform:IfalldistinctsubstringsofstringSweresortedlexicographically,whichonewillbetheK-thsmallest?AfterknowingthehugenumberofquestionsKinanwillask,Danielfiguredoutthathecan'tdothisalone.Daniel,ofcourse,knowsyourexc...
Astringisfinitesequenceofcharactersoveranon-emptyfinitesetΣ.Inthisproblem,Σisthesetoflowercaseletters.Substring,alsocalledfactor,isaconsecutivesequenceofcharactersoccurrencesatleastonceinastring.Nowyourtaskisabitharder,forsomegivenstrings,findthelengthofthelongestcommonsubstringofthem.Herecommonsubstringmeansasubstringoftwoormorestrings.InputTheinputcontainsatmost10lines,eachlineconsistso...
YouaregivenastringSwhichconsistsof250000lowercaselatinlettersatmost.WedefineF(x)asthemaximalnumberoftimesthatsomestringwithlengthxappearsinS.Forexampleforstring'ababa'F(3)willbe2becausethereisastring'aba'thatoccurstwice.YourtaskistooutputF(i)foreveryisothat1<=i<=|S|.InputStringSconsistsofatmost250000lowercaselatinletters.OutputOutput|S|lines.Onthei-thlineoutputF(i).Example...
DescriptionThelittlecatismajoringinphysicsinthecapitalofByterland.Apieceofsadnewscomestohimthesedays:hismotherisgettingill.Beingworriedaboutspendingsomuchonrailwaytickets(Byterlandissuchabigcountry,andhehastospend16shoursontraintohishometown),hedecidedonlytosendSMSwithhismother.Thelittlecatlivesinanunrichfamily,sohefrequentlycomestothemobileservicecenter,tocheckhowmuchmoneyhehasspentonS...
近期评论