Redian新闻
>
请教一下一道EPI上面的题
avatar
请教一下一道EPI上面的题# JobHunting - 待字闺中
s*8
1
There are 25 people seated at a round table.Each person has two cards. Each
card has a number from 1 to 25. Each number appears on exactly two cards.
each person passes the card with the smaller number to the person on his
left. This is done iteratively in a synchronized fashion. Show that
eventually someone will have two cards with identical number. 不太清楚怎么推
导, 请版上的朋友指导. 谢谢
avatar
l*4
2
可以不可以这么想:
一开始两个25 会被locate到两个不同的位置,因为是能移动的当前最大
然后两个24 会被locate到两个不同的位置,因为是能移动的当前最大
然后两个23 会被locate到两个不同的位置,因为是能移动的当前最大
.
.
.
然后两个13 会被locate到两个不同的位置,因为是能移动的当前最大
然后一个12 会被locate到一个位置,因为是能移动的当前最大且只有一个空格
剩下的另一个12会被一直pass,直到pass到那个有12的人手上
So someone have two cards with identical number eventually
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。