[測試] test已刪文

看板Test作者 (中古世紀之騎士比武大會)時間6年前 (2019/05/14 16:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1030/7293 (看更多)
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.1557822259.A.431.html
文章代碼(AID): #1SsdipGn (Test)
討論串 (同標題文章)
完整討論串 (本文為第 1030 之 7293 篇):
測試
測試
測試
1
1
18小時前, 02/02
測試
測試
1
1
測試
測試
測試
測試
1
1
文章代碼(AID): #1SsdipGn (Test)