Imaginethatyouareinabuildingthathasexactlynfloors.Youcanmovebetweenthefloorsinalift.Let'snumberthefloorsfrombottomtotopwithintegersfrom1ton.Nowyou'reonthefloornumbera.Youareverybored,soyouwanttotakethelift.Floornumberbhasasecretlab,theentryisforbidden.However,youalreadyareinthemoodanddecidetomakekconsecutivetripsinthelift.Letussupposethatatthemomentyouareonthefloornumberx(initially,youwere...
ValeryisaPEteacherataschoolinBerland.Soonthestudentsaregoingtotakeatestinlongjumps,andValeryhaslosthisfavoriteruler!However,thereisnoreasonfordisappointment,asValeryhasfoundanotherruler,itslengthislcentimeters.Theruleralreadyhasnmarks,withwhichhecanmakemeasurements.Weassumethatthemarksarenumberedfrom1tonintheordertheyappearfromthebeginningoftherulertoitsend.Thefirstpointcoincideswiththe...
StudentValeraisanundergraduatestudentattheUniversity.Hisendoftermexamsareapproachingandheistopassexactlynexams.Valeraisasmartguy,sohewillbeabletopassanyexamhetakesonhisfirsttry.Besides,hecantakeseveralexamsononeday,andinanyorder.Accordingtotheschedule,astudentcantaketheexamforthei-thsubjectonthedaynumberai.However,Valerahasmadeanarrangementwitheachteacherandtheteacherofthei-thsubjectallow...
PachinkoisaJapanesegameplayedforamusementandprizes,andissimilartopinball.Thegameisverysimple:youshootsmallmetalballsintothemachineandtheyfalldown,bouncingofftheobstaclesuntiltheyfallintoagate.Thegateintowhichyourballfallsdeterminesthewinnings.Sinceyoucanmoreorlessdeterminethecolumnintowhichtheballisdropped(bysettingitsinitialspeedanddirection),youcaninfluenceyourwinchances.Youaretocalculatey...
Optiversponsoredproblem.AfteryearsofhardworkOptiverhasdevelopedamathematicalmodelthatallowsthemtopredictwetherornotacompanywillbesuccesful.Thisobviouslygivesthemagreatadvantageonthestockmarket.Inthepast,Optivermadeadealwithabigcompany,whichforcesthemtobuysharesofthecompanyaccordingtoafixedschedule.Unfortunately,Optiver’smodelhasdeterminedthatthecompanywillgobankruptafterexactlyndays,after...
近期评论