Youaregivenanencryptedstring,encryptedusingacertainalgorithm.Decryptit!InputThefirstandonlylineofinputcontainsastrings,eachcharacterofsiseither0or1.(8 ≤ |s| ≤ 8 × 104)OutputPrinttheoriginalstring.Sampletest(s)input[crayon-6740acc382c90975876406/]output[crayon-6740acc382caf410595276/]input[crayon-6740acc382cb3912289234/]output[crayon-6740acc382cb6509154725/]input[crayon-6740acc382cb...
Youaregivenanencryptedstring,encryptedusingacertainalgorithm.Decryptit!InputThefirstandsinglelineofinputcontainsastrings,whicheachofit'scharactersisalowercaseEnglishletter.(1 ≤ |s| ≤ 105)OutputPrinttheoriginalstring.Sampletest(s)input[crayon-6740acc38310a687762409/]output[crayon-6740acc383112190609551/]input[crayon-6740acc383116875321668/]output[crayon-6740acc383119546208621/]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...
近期评论