I seem to get 1773 for test case 6.
I also get 1773 for test case 6
I'll look into it a bit later on. In the meantime, that test case is deleted, so you can see if your solutions work for the rest of the test cases.
An interesting test case would have kill_every=1.
Am I the only one who finds the problem description really lacking? WTF does it mean "Because Prisoner 10 was counted during the first iteration,..." IMHO this is just blah and not a well-defined problem definition...
I passed test 3 by using a WHILE loop but not a recursive function. IMHO the method should not affect the test cases but in this case it does.
This is a hard one it took me a while to solve it. Thanks God Roman empire has fallen log time ago otherwise I would have no chance to escape decimation.
test 3 fails. not because of an infinite recursion in my program but owing to the lack of memory. My program is correct
really wonderful thought!!! One of the best solution!
how does this work?
To paraphrase Arthur C Clarke: "Any sufficiently advanced Cody solution from Alfonso is indistinguishable from magic."
sdrawkcaB
Generalized Josephus problem
great solution! (effectively working backwards to get the initial state)
It dseon't mettar waht oedrr the lrettes in a wrod are.
653 Solvers
Set some matrix elements to zero
290 Solvers
Count consecutive 0's in between values of 1
164 Solvers
377 Solvers
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
761 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!