Afterthesuccessof2ndanniversary(takealookatproblemFTOURformoredetails),this3rdyear,TravelAgentSPOJgoesonwithanotherdiscounttour.ThetourwillbeheldonICPCisland,amiraculousoneonthePacificOcean.WelistNplaces(indexedfrom1toN)wherethevisitorscanhaveatrip.Eachroadconnectingthemhasaninterestvalue,andthisvaluecanbenegative(ifthereisnothinginterestingtoviewthere).Simply,theseNplaces...
DescriptionYouaregivenatreewithNnodes.Thetree’snodesarenumbered1throughNanditsedgesarenumbered1throughN−1.Eachedgeisassociatedwithaweight.Thenyouaretoexecuteaseriesofinstructionsonthetree.Theinstructionscanbeoneofthefollowingforms:CHANGEivChangetheweightoftheithedgetovNEGATEabNegatetheweightofeveryedgeonthepathfromatobQUERYabFindthemaximumweightofedgesonthepathfromat...
近期评论