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...
近期评论