DescriptionBeingwellknownforitshighlyinnovativeproducts,Merckwoulddefinitelybeagoodtargetforindustrialespionage.Toprotectitsbrand-newresearchanddevelopmentfacilitythecompanyhasinstalledthelatestsystemofsurveillancerobotspatrollingthearea.Theserobotsmovealongthewallsofthefacilityandreportsuspiciousobservationstothecentralsecurityoffice.Theonlyflawinthesystemacompetitor抯agentcouldfindisthefac...
DescriptionA latticepoint isanorderedpair(x, y)where x and y arebothintegers.Giventhecoordinatesoftheverticesofatriangle(whichhappentobelatticepoints),youaretocountthenumberoflatticepointswhichliecompletelyinsideofthetriangle(pointsontheedgesorverticesofthetriangledonotcount).InputTheinputtestfilewillcontainmultipletestcases.Eachinputtestcaseconsistsofsixintegers x1, y1, x2, y2, ...
DescriptionYouaregoingtocomputetheareaofaspecialkindofpolygon.Onevertexofthepolygonistheoriginoftheorthogonalcoordinatesystem.Fromthisvertex,youmaygostepbysteptothefollowingvertexesofthepolygonuntilbacktotheinitialvertex.ForeachstepyoumaygoNorth,West,SouthorEastwithsteplengthof1unit,orgoNorthwest,Northeast,SouthwestorSoutheastwithsteplengthofsquarerootof2.Forexample,thisisalegalpolyg...
DescriptionTheGXLightPipelineCompanystartedtopreparebentpipesforthenewtransgalacticlightpipeline.Duringthedesignphaseofthenewpipeshapethecompanyranintotheproblemofdetermininghowfarthelightcanreachinsideeachcomponentofthepipe.Notethatthematerialwhichthepipeismadefromisnottransparentandnotlightreflecting.Eachpipecomponentconsistsofmanystraightpipesconnectedtightlytogether.Fortheprogrammin...
DescriptionIt'srainingoutside.FarmerJohnson'sbullBenwantssomeraintowaterhisflowers.Bennailstwowoodenboardsonthewallofhisbarn.Showninthepicturesbelow,thetwoboardsonthewalljustlookliketwosegmentsontheplane,astheyhavethesamewidth.Yourmissionistocalculatehowmuchrainthesetwoboardscancollect.InputThefirstlinecontainsthenumberoftestcases.Eachtestcaseconsistsof8integersnotexceeding10,000byabsol...
DescriptionYouaretowriteaprogramthathastodecidewhetheragivenlinesegmentintersectsagivenrectangle.Anexample:line:startpoint:(4,9)endpoint:(11,2)rectangle:left-top:(1,5)right-bottom:(7,1)Figure1:LinesegmentdoesnotintersectrectangleThelineissaidtointersecttherectangleifthelineandtherectanglehaveatleastonepointincommon.Therectangleconsistsoffourstraightlinesandtheareainbetween.Althoughallinput...
DescriptionArcheologistsfromtheAntiquitiesandCuriosMuseum(ACM)haveflowntoEgypttoexaminethegreatpyramidofKey-Ops.Usingstate-of-the-arttechnologytheyareabletodeterminethatthelowerfloorofthepyramidisconstructedfromaseriesofstraightlinewalls,whichintersecttoformnumerousenclosedchambers.Currently,nodoorsexisttoallowaccesstoanychamber.Thisstate-of-the-arttechnologyhasalsopinpointedthelocat...
DescriptionYouaretofindthelengthoftheshortestpaththroughachambercontainingobstructingwalls.Thechamberwillalwayshavesidesatx=0,x=10,y=0,andy=10.Theinitialandfinalpointsofthepatharealways(0,5)and(10,5).Therewillalsobefrom0to18verticalwallsinsidethechamber,eachwithtwodoorways.Thefigurebelowillustratessuchachamberandalsoshowsthepathofminimallength.InputTheinputdatafortheillustratedchamberwould...
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0<=N<=100,000)onanumberlineandthecowisatapointK(0<=K<=100,000)onthesamenumberline.FarmerJohnhastwomodesoftransportation:walkingandteleporting.*Walking:FJcanmovefromanypointXtothepointsX-1orX+1inasingleminute*Teleporting:FJcanmovefromanypointXtothepoint2*Xi...
近期评论