Problem 1092. Decimation
Solution Stats
Problem Comments
-
5 Comments
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...
Solution Comments
-
2 Comments
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.
-
1 Comment
test 3 fails. not because of an infinite recursion in my program but owing to the lack of memory. My program is correct
-
1 Comment
really wonderful thought!!! One of the best solution!
-
4 Comments
how does this work?
To paraphrase Arthur C Clarke: "Any sufficiently advanced Cody solution from Alfonso is indistinguishable from magic."
sdrawkcaB
Generalized Josephus problem
-
1 Comment
great solution! (effectively working backwards to get the initial state)
Problem Recent Solvers173
Suggested Problems
-
421 Solvers
-
303 Solvers
-
Determine the number of odd integers in a vector
537 Solvers
-
271 Solvers
-
Find the index of n in magic(n)
182 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!