I don't remember much from the story, but what really marked me was that everyone on a planet competed in a competition to become King of the planet, yet the one that won would be killed afterwards. I also remember that murder was legal during the competition, and I think a conscious machine was behind it all.
It was a short story, part of a volume I read when I was a lot younger (would be at least 30 years old).