Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sobreviviente(m,x):
- a = [True]*m
- contador = 0
- while a.count(True)!=1:
- for i in range(m):
- if not (a[i]):
- continue
- contador = contador + 1
- if(contador==x and a[i]):
- a[i] = False
- contador=0
- #print a,contador
- #raw_input()
- return a.index(True) + 1
- print sobreviviente(12,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement