[測試] test已刪文

看板Test作者 (中古世紀之騎士比武大會)時間6年前 (2019/05/14 16:18), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1029/7268 (看更多)
StringAndSubstringDescriptionYouaregivenastringsandanintegerm,yourtaskistosolvetwoproblems:Findalongeststringt,sothattisasubstringofs,andappearsatleastmtimesins.Thedefinitionofsubstringisasequenceofconsecutivecharactersinastring.Forexample,s=baaaababababbababbab,m3,thentheanswerwouldbebabab,sincethereisnoothersubstringofsislongerthanbababandappearsatleast3timesinstrings.Findalongeststringr,suchthatrisaprefixofsandasuffixofs.Inotherwords,risthebeginningofthestringsandtheendofthestrings.Tomakeitmorechalleng ing,stringralsoneedtobeabletobelocatedsomewhereinsidethestrings,thatis,itisneitherbeginning,noritsend.Forexample,s=abcdabcabc,theanswerisabc,becauseitappearsatpositions0prefix,4neitherprefixnorsuffix,7suffix,whichmeetstherequirements.InputFormatTheinputcontainsseveraltestcases.Eachtestcaseconsistsofalinewithanintegermm1,theminimumnumberofrepetitions,followdbyalinecontainingastrings.Allcharactersinsarelowercasecharactersfromatoz.Thelasttestcaseisdenotedbym0andmustnotbeprocessed.OutputFormatForeachtestcase, youneedtoprinttwolinesofanswers:Forproblem1,ifthereisnosolution,outputnonewithoutthequotes;otherwise,printtwointegersinaline,separatedbyaspace.Thefirstintegerdenotesthemaximumlengthofasubstringappearingatleastmtimes;thesecondintegeristherightmostpossiblestartingpositionofsuchasubstring.Forproblem2,printthestringthatmeetstherequirements.Ifasuitablestringdoesnotexist,thenprintJustalegendwithoutthequotes. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.204.25.70 ※ 文章網址: https://www.ptt.cc/bbs/Test/M.1557821913.A.FAA.html
文章代碼(AID): #1SsddP-g (Test)
討論串 (同標題文章)
完整討論串 (本文為第 1029 之 7268 篇):
測試
測試
測試
1
1
測試
1
2
測試
1
1
測試
測試
測試
1
1
測試
1
1
測試
1
1
文章代碼(AID): #1SsddP-g (Test)