|
6 | 6 |
|
7 | 7 | <!-- 这里写题目描述 -->
|
8 | 8 |
|
9 |
| -<p>给你一个 <code>m * n</code> 的矩阵 <code>seats</code> 表示教室中的座位分布。如果座位是坏的(不可用),就用 <code>'#'</code> 表示;否则,用 <code>'.'</code> 表示。</p> |
| 9 | +<p>给你一个 <code>m * n</code> 的矩阵 <code>seats</code> 表示教室中的座位分布。如果座位是坏的(不可用),就用 <code>'#'</code> 表示;否则,用 <code>'.'</code> 表示。</p> |
10 | 10 |
|
11 |
| -<p>学生可以看到左侧、右侧、左上、右上这四个方向上紧邻他的学生的答卷,但是看不到直接坐在他前面或者后面的学生的答卷。请你计算并返回该考场可以容纳的一起参加考试且无法作弊的最大学生人数。</p> |
| 11 | +<p>学生可以看到左侧、右侧、左上、右上这四个方向上紧邻他的学生的答卷,但是看不到直接坐在他前面或者后面的学生的答卷。请你计算并返回该考场可以容纳的同时参加考试且无法作弊的 <strong>最大 </strong>学生人数。</p> |
12 | 12 |
|
13 | 13 | <p>学生必须坐在状况良好的座位上。</p>
|
14 | 14 |
|
15 | 15 | <p> </p>
|
16 | 16 |
|
17 | 17 | <p><strong>示例 1:</strong></p>
|
18 | 18 |
|
19 |
| -<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1300-1399/1349.Maximum%20Students%20Taking%20Exam/images/image.png" style="height: 197px; width: 339px;"></p> |
| 19 | +<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1300-1399/1349.Maximum%20Students%20Taking%20Exam/images/image.png" style="height: 197px; width: 339px;" /></p> |
20 | 20 |
|
21 |
| -<pre><strong>输入:</strong>seats = [["#",".","#","#",".","#"], |
22 |
| - [".","#","#","#","#","."], |
23 |
| - ["#",".","#","#",".","#"]] |
| 21 | +<pre> |
| 22 | +<strong>输入:</strong>seats = [["#",".","#","#",".","#"], |
| 23 | + [".","#","#","#","#","."], |
| 24 | + ["#",".","#","#",".","#"]] |
24 | 25 | <strong>输出:</strong>4
|
25 | 26 | <strong>解释:</strong>教师可以让 4 个学生坐在可用的座位上,这样他们就无法在考试中作弊。
|
26 | 27 | </pre>
|
27 | 28 |
|
28 | 29 | <p><strong>示例 2:</strong></p>
|
29 | 30 |
|
30 |
| -<pre><strong>输入:</strong>seats = [[".","#"], |
31 |
| - ["#","#"], |
32 |
| - ["#","."], |
33 |
| - ["#","#"], |
34 |
| - [".","#"]] |
| 31 | +<pre> |
| 32 | +<strong>输入:</strong>seats = [[".","#"], |
| 33 | + ["#","#"], |
| 34 | + ["#","."], |
| 35 | + ["#","#"], |
| 36 | + [".","#"]] |
35 | 37 | <strong>输出:</strong>3
|
36 | 38 | <strong>解释:</strong>让所有学生坐在可用的座位上。
|
37 | 39 | </pre>
|
38 | 40 |
|
39 | 41 | <p><strong>示例 3:</strong></p>
|
40 | 42 |
|
41 |
| -<pre><strong>输入:</strong>seats = [["#",".","<strong>.</strong>",".","#"], |
42 |
| - ["<strong>.</strong>","#","<strong>.</strong>","#","<strong>.</strong>"], |
43 |
| - ["<strong>.</strong>",".","#",".","<strong>.</strong>"], |
44 |
| - ["<strong>.</strong>","#","<strong>.</strong>","#","<strong>.</strong>"], |
45 |
| - ["#",".","<strong>.</strong>",".","#"]] |
| 43 | +<pre> |
| 44 | +<strong>输入:</strong>seats = [["#",".","<strong>.</strong>",".","#"], |
| 45 | + ["<strong>.</strong>","#","<strong>.</strong>","#","<strong>.</strong>"], |
| 46 | + ["<strong>.</strong>",".","#",".","<strong>.</strong>"], |
| 47 | + ["<strong>.</strong>","#","<strong>.</strong>","#","<strong>.</strong>"], |
| 48 | + ["#",".","<strong>.</strong>",".","#"]] |
46 | 49 | <strong>输出:</strong>10
|
47 | 50 | <strong>解释:</strong>让学生坐在第 1、3 和 5 列的可用座位上。
|
48 | 51 | </pre>
|
|
52 | 55 | <p><strong>提示:</strong></p>
|
53 | 56 |
|
54 | 57 | <ul>
|
55 |
| - <li><code>seats</code> 只包含字符 <code>'.' 和</code><code>'#'</code></li> |
| 58 | + <li><code>seats</code> 只包含字符 <code>'.' 和</code><code>'#'</code></li> |
56 | 59 | <li><code>m == seats.length</code></li>
|
57 | 60 | <li><code>n == seats[i].length</code></li>
|
58 | 61 | <li><code>1 <= m <= 8</code></li>
|
|
0 commit comments