Problem 47668. A KING AND 100 PRISONERS
Solution Stats
Problem Comments
-
3 Comments
Nice. On the other hand, the test suite should probably forbid people from returning any number between 20 and 40. Just open the file and look for these numbers and their multiples explicitly.
And by the way, it would be faster if all prisoners could turn off the light. They only need to have a variable known by all who share the room but the king. Leave the king doubtful and in the dark, so they would all go free.
On top of what Rafael said, "20 <= prisoners <= 40" does not do what you apparently think it does.
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
-
Find the sum of the elements in the "second" diagonal
1172 Solvers
-
Given a matrix, return the last eigen value
227 Solvers
-
Create the following sequence : 0 1 1 4 9 25 64 169 ...
199 Solvers
-
Matlab Basics II - Determine if an array has a 3rd dimension
156 Solvers
-
103 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!