mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 06:22:54 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>在考场里,一排有 <code>N</code> 个座位,分别编号为 <code>0, 1, 2, ..., N-1</code> 。</p>\n\n<p>当学生进入考场后,他必须坐在能够使他与离他最近的人之间的距离达到最大化的座位上。如果有多个这样的座位,他会坐在编号最小的座位上。(另外,如果考场里没有人,那么学生就坐在 0 号座位上。)</p>\n\n<p>返回 <code>ExamRoom(int N)</code> 类,它有两个公开的函数:其中,函数 <code>ExamRoom.seat()</code> 会返回一个 <code>int</code> (整型数据),代表学生坐的位置;函数 <code>ExamRoom.leave(int p)</code> 代表坐在座位 <code>p</code> 上的学生现在离开了考场。每次调用 <code>ExamRoom.leave(p)</code> 时都保证有学生坐在座位 <code>p</code> 上。</p>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre><strong>输入:</strong>["ExamRoom","seat","seat","seat","seat","leave","seat"], [[10],[],[],[],[],[4],[]]\n<strong>输出:</strong>[null,0,9,4,2,null,5]\n<strong>解释:</strong>\nExamRoom(10) -> null\nseat() -> 0,没有人在考场里,那么学生坐在 0 号座位上。\nseat() -> 9,学生最后坐在 9 号座位上。\nseat() -> 4,学生最后坐在 4 号座位上。\nseat() -> 2,学生最后坐在 2 号座位上。\nleave(4) -> null\nseat() -> 5,学生最后坐在 5 号座位上。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li><code>1 <= N <= 10^9</code></li>\n\t<li>在所有的测试样例中 <code>ExamRoom.seat()</code> 和 <code>ExamRoom.leave()</code> 最多被调用 <code>10^4</code> 次。</li>\n\t<li>保证在调用 <code>ExamRoom.leave(p)</code> 时有学生正坐在座位 <code>p</code> 上。</li>\n</ol>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 111,
|
||||
"likes": 115,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Maximize Distance to Closest Person\", \"titleSlug\": \"maximize-distance-to-closest-person\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5230\\u6700\\u8fd1\\u7684\\u4eba\\u7684\\u6700\\u5927\\u8ddd\\u79bb\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.5K\", \"totalSubmission\": \"15.8K\", \"totalAcceptedRaw\": 6474, \"totalSubmissionRaw\": 15843, \"acRate\": \"40.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.8K\", \"totalSubmission\": \"16.7K\", \"totalAcceptedRaw\": 6850, \"totalSubmissionRaw\": 16688, \"acRate\": \"41.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user