
TheemployeesoftheR1companyoftenspendtimetogether:theywatchfootball,theygocamping,theysolvecontests.So,it'snobigdealthatsometimessomeonepaysforsomeoneelse.Todayisthedayofgivingoutmoneyrewards.TheR1companyCEOwillinviteemployeesintohisofficeonebyone,rewardingeachoneforthehardworkthismonth.TheCEOknowswhoowesmoneytowhom.Andhealsounderstandsthatifheinvitesperson x tohisofficeforareward,a...
![「BZOJ1671」[Usaco2005 Dec] Knights of Ni 骑士](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_12-22-12.jpg)
DescriptionBessieisinCamelotandhasencounteredastickysituation:sheneedstopassthroughtheforestthatisguardedbytheKnightsofNi.Inordertopassthroughsafely,theKnightshavedemandedthatshebringthemasingleshrubbery.Timeisoftheessence,andBessiemustfindandbringthemashrubberyasquicklyaspossible.Bessiehasamapofoftheforest,whichispartitionedintoasquaregridarrayedintheusualmanner,withaxesparalleltotheXa...
![「BZOJ1646」[Usaco2007 Open] Catch That Cow 抓住那只牛](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_11-26-13.jpg)
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0<=N<=100,000)onanumberlineandthecowisatapointK(0<=K<=100,000)onthesamenumberline.FarmerJohnhastwomodesoftransportation:walkingandteleporting.*Walking:FJcanmovefromanypointXtothepointsX-1orX+1inasingleminute*Teleporting:FJcanmovefromanypointXtothepoint2*Xi...
![「BZOJ1648」[Usaco2006 Dec] Cow Picnic 奶牛野餐](http://hzwer.com/wp-content/themes/ly/image/image_post/572E19CF-1B2A-4ED3-A4B1-4DA6E0EEF191.png)
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...

DescriptionAcm,atreasure-explorer,isexploringagain.Thistimeheisinaspecialmaze,inwhichtherearesomedoors(atmost5doors,representedby'A','B','C','D','E'respectively).Inordertofindthetreasure,Acmmayneedtoopendoors.However,toopenadoorheneedstofindallthedoor'skeys(atleastone)inthemazefirst.Forexample,ifthereare3keysofDoorA,toopenthedoorheshouldfindallthe3keysfirst(that'sthree'a'swhichdenote...
近期评论