Combinatorics

Revision en2, by LIFE_GOES_ON, 2020-06-10 21:01:35

In this 294C - Shaass and Lights I do not understand clearly what to do next. I have figured out that if there are n off lights between two on lights , number of ways to turn them on is 2^(n-1) . And for consecutive off lights having only one adjacent on light can only be turned on in one way. In the third sample test case lights from 5 to 7 can be turned on in 2^2 ways . And lights from 1 to 3 can be turned on in 1 way. Also, lights from 9 to 11 can be turned on in 1 way. So answer will be X * 1 * 4 * 1 . Now how to find this "X" ??

Tags #combinatorics

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English LIFE_GOES_ON 2020-06-10 21:01:35 2 Tiny change: 'roblem:294D] I do not' -> 'roblem:294C] I do not'
en1 English LIFE_GOES_ON 2020-06-10 21:00:57 543 Initial revision (published)