HBC53385ProblemC:Circles4 Buttons题解

回忆凄美了谁 算法基础篇 57 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
Bobo lives in an infinite chessboard. Initially he locates at . There are 4 buttons. When the first button is pressed, Bobo moves right for at most a cells. When the second button is pressed, Bobo moves up for at most b cells. When the third button is pressed, Bobo moves left for at most c cells. When the fourth button is pressed, Bobo moves down for at most d cells. Find the number of cells Bobo can reach modulo , if he presses the buttons for no more than n times.

Bobo lives in an infinite chessboard. Initially he locates at (0, 0). There are 4 buttons. When the first button is pressed, Bobo moves right for at most a cells. When the second button is pressed, Bobo moves up for at most b cells. When the third button is pressed, Bobo moves left for at most c cells. When the fourth button is pressed, Bobo moves down for at most d cells. Find the number of cells Bobo can reach modulo (109+7)(10^9+7)(109+7), if he presses the buttons for no more than n times.

HBC53385ProblemC:Circles4 Buttons题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC53385ProblemC:Circles4 Buttons题解