May 2009 - May 2017 论坛八周年-你的足迹,我的骄傲



查看: 518|回复: 0

PopSugar OA

[复制链接] |试试Instant~ |关注本帖
cynthiazp 发表于 2015-9-3 13:38:39 | 显示全部楼层 |阅读模式

2015(7-9月) 码农类 硕士 全职@PopSugar - 网上海投 - HR筛选 |Otherfresh grad应届毕业生


您需要 登录 才可以下载或查看,没有帐号?获取更多干活,快来注册

Take a second to imagine that you are in a room with 100 chairs arranged in a circle. These chairs are numbered sequentially from One to One Hundred.
At some point in time, the person in chair #1 will be told to leave the room. The person in chair #2 will be skipped, and the person in chair #3 will be told to leave. Next to go is person in chair #6. In other words, 1 person will be skipped initially, and then 2, 3, 4.. and so on. This pattern of skipping will keep going around the circle until there is only one person remaining.. the survivor. Note that the chair is removed when the person leaves the room.

[size=12.8000001907349px]Write a program to figure out which chair the survivor is sitting in.



一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2017-5-30 11:49

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表