#P3857. [TJOI2008] 彩灯
[TJOI2008] 彩灯
Output Format
Output the number of distinct patterns obtainable by these switches and bulbs. Since this number can be large, output it modulo the integer .
2 3
OO
XO
OX
4
Hint
As seen in the sample, the first switch controls all bulbs, while the next two switches control the first and second bulbs respectively. In this case, using only the latter two switches suffices to obtain all states.
Constraints:
- For of the testdata, and do not exceed .
- Additionally, for of the testdata, one of and equals .
- For of the testdata, and do not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号