山东智趣岛论坛

标题: 666 [打印本页]

作者: 王浩宇    时间: 2024-7-9 11:53
标题: 666

成都石室中学、福建长乐一中信奥教练联合呈现。题库教师群:515658966,仅供教师加入
初赛题库:提高组 普及组

拥有自我:一本通自由题库

更多拥有:扩展题库  编程启蒙
你现在还未登录哦!
用户登录  找回密码
注册新用户
首页排名提交记录题目列表测试比赛教师频道正版书籍关于

2037:【例5.4】约瑟夫问题
时间限制: 1000 ms         内存限制: 65536 KB
提交数:62894    通过数: 34779

【题目描述】

<span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="N" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">N个人围成一圈,从第一个人开始报数,数到<span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" data-mathml="M" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">M的人出圈;再由下一个人开始报数,数到<span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" data-mathml="M" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">M的人出圈;…输出依次出圈的人的编号。


【输入】

输入<span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" data-mathml="N" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">N和<span class="MathJax" id="MathJax-Element-5-Frame" tabindex="0" data-mathml="M" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">M。


【输出】

输出一行,依次出圈的人的编号。


【输入样例】8 5【输出样例】5 2 8 7 1 4 6 3【提示】

【数据范围】

对于所有数据,<span class="MathJax" id="MathJax-Element-6-Frame" tabindex="0" data-mathml="2≤N,M≤1000" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">2≤N,M≤1000


[url=]提交[/url]统计信息


本题库与《信息学奥赛一本通(C++版)》(南京大学出版社)配套。
本网站属公益、非盈利性质,不涉及与书相关的商业活动,仅适当接受少量赞助以支持网站的运行维护。
感谢成都石室中学Wuvin、Qizy、Xehoth三位同学。蜀ICP备2024068936号-2  联系我们: 248801752@qq.com  23967609@qq.com






欢迎光临 山东智趣岛论坛 (https://abc.sdzqd.com/) Powered by Discuz! X3.3