![]() 成都石室中学、福建长乐一中信奥教练联合呈现。题库教师群: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++版)》(南京大学出版社)配套。 |
欢迎光临 山东智趣岛论坛 (https://abc.sdzqd.com/) | Powered by Discuz! X3.3 |