0
100 people standing in a circle in an order 1 to 100. No. 1 has a sword. He kills the next person (i.e. No. 2) and gives the swo
14 ответов
+ 2
The last one will survive, because when someone gives the sword to him, he couldn't kill the next person because he will be the only one left. Hope it helped.
+ 2
First of All,no.1 kills no. 2 and gives the sword to no.3, who kills no.4. If you continue, you realize that all even numbers will be killed(yeah, including no.100). Wether you do that on a piece of paper or do the coding, marking each set of eliminated numbers with a particular symbol, you'll notice that the elimination process unveils a pattern.{which doesn't seem necessary to solve your problem (you might just find it interesting, or you might understand something bigger. lol.)
}
So at the end of the elimination process, you find out that the survivor here will be number 41.
Now you just have to write the codes.. I might not be the best person to do that.
But... I might be wrong.
+ 1
No. 100
0
100 people standing in a circle in an order 1 to 100. No. 1 has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only 1 survives. Who will survive at the last?
0
Please answer
0
Nika please provide me proper Algo and if possible thn please write the code
0
only the 1st person will survive, because it will keep looping and eliminating one person until it reached out to the first person
- 1
C,Cpp,Java,Html. help
- 1
Mitali help
- 1
- 1
- 1
Bro I attempted but can't be able to solve
- 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 That's why I post
- 1
Ethan Zhu but how?