1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/破冰游戏 [yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof].html
2023-12-09 18:53:53 +08:00

29 lines
836 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>社团共有 <code>num</code> 为成员参与破冰游戏,编号为 <code>0 ~ num-1</code>。成员们按照编号顺序围绕圆桌而坐。社长抽取一个数字 <code>target</code>,从 0 号成员起开始计数,排在第 <code>target</code> 位的成员离开圆桌,且成员离开后从下一个成员开始计数。请返回游戏结束时最后一位成员的编号。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>num = 7, target = 4
<strong>输出:</strong>1
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>num = 12, target = 5
<strong>输出:</strong>0
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= num &lt;= 10^5</code></li>
<li><code>1 &lt;= target&nbsp;&lt;= 10^6</code></li>
</ul>
<p>&nbsp;</p>