Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. def sobreviviente(m,x):
  2. a = [True]*m
  3. contador = 0
  4. while a.count(True)!=1:
  5. for i in range(m):
  6. if not (a[i]):
  7. continue
  8. contador = contador + 1
  9. if(contador==x and a[i]):
  10. a[i] = False
  11. contador=0
  12. #print a,contador
  13. #raw_input()
  14. return a.index(True) + 1
  15.  
  16.  
  17. print sobreviviente(12,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement