DescriptionFarmerJohngoestoDollarDaysatTheCowStoreanddiscoversanunlimitednumberoftoolsonsale.Duringhisfirstvisit,thetoolsaresellingvariouslyfor$1,$2,and$3.FarmerJohnhasexactly$5tospend.Hecanbuy5toolsat$1eachor1toolat$3andanadditional1toolat$2.Ofcourse,thereareothercombinationsforatotalof5differentwaysFJcanspendallhismoneyontools.Heretheyare:1@US$3+1@US$21@US$3+2@US$11@US$...
Applemanhasatreewith n vertices.Someofthevertices(atleastone)arecoloredblackandotherverticesarecoloredwhite.Considerasetconsistingof k (0 ≤ k < n) edgesofAppleman'stree.IfApplemandeletestheseedgesfromthetree,thenitwillsplitinto (k + 1) parts.Note,thateachpartwillbeatreewithcoloredvertices.NowApplemanwonders,whatisthenumberofsetssplittingthetreeinsuchawaythateachresultingp...
Pashmak'shomeworkisaproblemaboutgraphs.Althoughhealwaystriestodohishomeworkcompletely,hecan'tsolvethisproblem.Asyouknow,he'sreallyweakatgraphtheory;sotrytohelphiminsolvingtheproblem.Youaregivenaweighteddirectedgraphwith n verticesand m edges.Youneedtofindapath(perhaps,non-simple)withmaximumnumberofedges,suchthattheweightsoftheedgesincreasealongthepath.Inotherwords,eachedgeofthepathmustha...
Alexdoesn'tlikeboredom.That'swhywheneverhegetsbored,hecomesupwithgames.Onelongwintereveninghecameupwithagameanddecidedtoplayit.Givenasequence a consistingof n integers.Theplayercanmakeseveralsteps.Inasinglestephecanchooseanelementofthesequence(let'sdenoteit ak)anddeleteit,atthatallelementsequalto ak + 1 and ak - 1 alsomustbedeletedfromthesequence.Thatstepbrings ak pointstothe...
近期评论