约瑟夫问题 II
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目背景
翻译自 CSES-2163 题。
题目描述
在游戏中,一个圆圈里有 个孩子(编号为 )。在游戏过程中,每隔 个孩子就要从圆圈中移走一个,直到没有孩子为止。这些孩子将按什么顺序被移走?
输入格式
第一行输入两个整数 和 。
输出格式
输出 个整数,表示移除顺序。
样例
7 2
3 6 2 7 5 1 4
说明/提示
;
。
A班12.04基本功测试
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2025-12-4 14:00
- End at
- 2025-12-4 16:30
- Duration
- 2.5 hour(s)
- Host
- Partic.
- 22