Youareanassistantdirectorinanewmusicalplay.Theplayconsistsofnmusicalparts,eachpartmustbeperformedbyexactlyoneactor.Afterthecastingthedirectorchosemactorswhocantakepartintheplay.Yourtaskistoassignthepartstoactors.However,thereareseverallimitations.First,eachactorhasacertainvoicerangeandtherearesomepartsthathecannotsing.Formally,therearetwointegersforeachactor,cianddi(ci ≤ di) —thepitcho...
PetyaandGenaloveplayingtabletennis.Asinglematchisplayedaccordingtothefollowingrules:amatchconsistsofmultiplesets,eachsetconsistsofmultipleserves.Eachserveiswonbyoneoftheplayers,thisplayerscoresonepoint.Assoonasoneoftheplayersscorestpoints,hewinstheset;thenthenextsetstartsandscoresofbothplayersarebeingsetto0.Assoonasoneoftheplayerswinsthetotalofssets,hewinsthematchandthematchisover.Heresandt...
Youaregivenann × mrectangulartableconsistingoflowercaseEnglishletters.Inoneoperationyoucancompletelyremoveonecolumnfromthetable.Theremainingpartsarecombinedforminganewtable.Forexample,afterremovingthesecondcolumnfromthetable[crayon-67b78dc297fae522367721/]weobtainthetable:[crayon-67b78dc297fb6056871683/]Atableiscalledgoodifitsrowsareorderedfromtoptobottomlexicographically,i.e.eachrowislex...
近期评论