Understand king of the ring ...

the problem http://www.codechef.com/PRST2013/problems/P1308
has accepted solution
http://www.codechef.com/viewsolution/1811877

what is the concept behind the code …its a tricky problem…:frowning:

1 Like

This problem is a very standard classical problem known as Josephus problem. You can find a plenty of problems as direct application of it in the contest. The following links contains a good explanation of the problem:

  1. Josephus Problem
  2. GeeksforGeeks

Some of the problems on codechef that can be solved using the Josephus problem are:

  1. Electricity Cutoff
  2. Find the Goal Keeper

I hope it helps.

1 Like

one good and detailed study of josephus problem is done in the COncrete MAthematics By Graham,Knuth and patashnik … Its very entertaining to study and even more interesting to implement…

1 Like