DescriptionEverthematuringbusinessman,FarmerJohnrealizesthathemustmanagehistimeeffectively.HehasNjobsconvenientlynumbered1..N(1<=N<=1,000)toaccomplish(likemilkingthecows,cleaningthebarn,mendingthefences,andsoon).Tomanagehistimeeffectively,hehascreatedalistofthejobsthatmustbefinished.JobirequiresacertainamountoftimeT_i(1<=T_i<=1,000)tocompleteandfurthermoremustbefinishedbyti...
DescriptionThecowsarehavingapicnic!EachofFarmerJohn'sK(1<=K<=100)cowsisgrazinginoneofN(1<=N<=1,000)pastures,convenientlynumbered1...N.ThepasturesareconnectedbyM(1<=M<=10,000)one-waypaths(nopathconnectsapasturetoitself).Thecowswanttogatherinthesamepasturefortheirpicnic,but(becauseoftheone-waypaths)somecowsmayonlybeabletogettosomepastures.Helpthecowsoutbyfiguringouth...
DescriptionFJ'sN(1<=N<=10,000)cowsconvenientlyindexed1..Narestandinginaline.Eachcowhasapositiveintegerheight(whichisabitofsecret).YouaretoldonlytheheightH(1<=H<=1,000,000)ofthetallestcowalongwiththeindexIofthatcow.FJhasmadealistofR(0<=R<=10,000)linesoftheform"cow17seescow34".Thismeansthatcow34isatleastastallascow17,andthateverycowbetween17and34hasaheightthatisstri...
近期评论