HBC223711黑妹的游戏V,枚举True/FalseWorksheet题解

一点都不欢乐 算法基础篇 71 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Bob is completing a true/false worksheet, consisting of a list of n problems where each answer is either “true” or “false”. The problems are numbered from 1 to n. They are too hard for Bob, so the TA, Alice, has given Bob m hints. For each hint i, Alice gives Bob an range of questions [li , ri ], and tells him either “all answers in the range are the same” ; or “not all of the answers in the range are the same.” Help Bob count how many different answer sequences satisfy the given hints. Since this number may be huge, print the answer modulo 109 + 7.

Bob is completing a true/false worksheet, consisting of a list of n problems where each answer is either “true” or “false”. The problems are numbered from 1 to n. They are too hard for Bob, so the TA, Alice, has given Bob m hints. For each hint i, Alice gives Bob an (inclusive) range of questions [li , ri ], and tells him either “all answers in the range are the same” (in other words, either all are “true”, or all are “false”); or “not all of the answers in the range are the same.” Help Bob count how many different answer sequences satisfy the given hints. Since this number may be huge, print the answer modulo 109 + 7.

HBC223711黑妹的游戏V,枚举True/FalseWorksheet题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC223711黑妹的游戏V 枚举True/FalseWorksheet题解