Pashmak'shomeworkisaproblemaboutgraphs.Althoughhealwaystriestodohishomeworkcompletely,hecan'tsolvethisproblem.Asyouknow,he'sreallyweakatgraphtheory;sotrytohelphiminsolvingtheproblem.Youaregivenaweighteddirectedgraphwith n verticesand m edges.Youneedtofindapath(perhaps,non-simple)withmaximumnumberofedges,suchthattheweightsoftheedgesincreasealongthepath.Inotherwords,eachedgeofthepathmustha...
RecentlyPashmakhasbeenemployedinatransportationcompany.Thecompanyhas k busesandhasacontractwithaschoolwhichhas n students.Theschoolplannedtotakethestudentsto d differentplacesfor d days(eachdayinoneplace).Eachdaythecompanyprovidesallthebusesforthetrip.Pashmakhastoarrangethestudentsinthebuses.Hewantstoarrangethestudentsinawaythatnotwostudentsbecomeclosefriends.Inhisridiculousidea,tw...
PashmakdecidedtogiveParmidaapairofflowersfromthegarden.Thereare n flowersinthegardenandthe i-thofthemhasabeautynumber bi.Parmidaisaverystrangegirlsoshedoesn'twanttohavethetwomostbeautifulflowersnecessarily.Shewantstohavethosepairsofflowersthattheirbeautydifferenceismaximalpossible!Yourtaskistowriteaprogramwhichcalculatestwothings:ThemaximumbeautydifferenceofflowersthatPashmakcangivetoP...
PashmakhasfalleninlovewithanattractivegirlcalledParmidasinceoneyearago...Today,Pashmaksetupameetingwithhispartnerinaromanticgarden.Unfortunately,Pashmakhasforgottenwherethegardenis.Butheremembersthatthegardenlookslikeasquarewithsidesparalleltothecoordinateaxes.Healsoremembersthatthereisexactlyonetreeoneachvertexofthesquare.Now,Pashmakknowsthepositionofonlytwoofthetrees.Helphimtofindthep...
近期评论