HBC236506[ZJOI2006]BOOK 书架,平衡树,数据结构Blocks题解

淫家是湿人 算法基础篇 33 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
Painting is always a boring job. There are nnn blocks on an infinite two-dimensional plane. Each block is a rectangle parallel to the xxx-axis and yyy-axis with a non-zero area. The coordinates of b

Painting is always a boring job. There are nnn blocks on an infinite two-dimensional plane. Each block is a rectangle parallel to the xxx-axis and yyy-axis with a non-zero area.  The coordinates of bottom-left corner and top-right corner of the iii-th block are (x1,i,y1,i)(x_{1,i},y_{1,i})(x1,i​,y1,i​) and (x2,i,y2,i)(x_{2,i},y_{2,i})(x2,i​,y2,i​).  There is another block with coordinates of bottom-left corner and top-right corner are (0,0)(0,0)(0,0) and (W,H)(W,H)(W,H). Nike wants to paint this block black. He will repeatedly choose one of the previous nnn blocks uniformly at random and independently and fill it black, until the rectangle ((0,0),(W,H))((0,0),(W,H))((0,0),(W,H)) is completely filled black.  Find the expected value of the number of times the procedure is done, modulo 998244353998244353998244353. If the procedure is impossible to stop, output −1-1−1.

HBC236506[ZJOI2006]BOOK 书架,平衡树,数据结构Blocks题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC236506[ZJOI2006]BOOK 书架 平衡树 数据结构Blocks题解