Skip to content

Commit 76a6aa6

Browse files
committed
feat: update
1 parent 35bbf7e commit 76a6aa6

File tree

10 files changed

+72
-32
lines changed

10 files changed

+72
-32
lines changed

solution/3000-3099/3086.Minimum Moves to Pick K Ones/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tags:
4444
<p><strong>解释:</strong>如果游戏开始时&nbsp;Alice 在 <code>aliceIndex == 1</code> 的位置上,按照以下步骤执行每个动作,他可以利用 <code>3</code> 次行动拾取 <code>3</code> 个 1 :</p>
4545

4646
<ul>
47-
<li>游戏开始时&nbsp;Alice 拾取了一个 1 ,<code>nums[1]</code> 变成了 <code>0</code>。此时 <code>nums</code> 变为 <code>[1,<strong><u>1</u></strong>,1,0,0,1,1,0,0,1]</code> 。</li>
47+
<li>游戏开始时&nbsp;Alice 拾取了一个 1 ,<code>nums[1]</code> 变成了 <code>0</code>。此时 <code>nums</code> 变为 <code>[1,<strong><u>0</u></strong>,1,0,0,1,1,0,0,1]</code> 。</li>
4848
<li>选择 <code>j == 2</code> 并执行第一种类型的动作。<code>nums</code> 变为 <code>[1,<strong><u>0</u></strong>,1,0,0,1,1,0,0,1]</code></li>
4949
<li>选择 <code>x == 2</code> 和 <code>y == 1</code> ,并执行第二种类型的动作。<code>nums</code> 变为 <code>[1,<strong><u>1</u></strong>,0,0,0,1,1,0,0,1]</code> 。由于 <code>y == aliceIndex</code>,Alice 拾取了一个 1 ,<code>nums</code> 变为&nbsp; <code>[1,<strong><u>0</u></strong>,0,0,0,1,1,0,0,1]</code> 。</li>
5050
<li>选择 <code>x == 0</code> 和 <code>y == 1</code> ,并执行第二种类型的动作。<code>nums</code> 变为 <code>[0,<strong><u>1</u></strong>,0,0,0,1,1,0,0,1]</code> 。由于 <code>y == aliceIndex</code>,Alice 拾取了一个 1 ,<code>nums</code> 变为&nbsp; <code>[0,<strong><u>0</u></strong>,0,0,0,1,1,0,0,1]</code> 。</li>

solution/3100-3199/3199.Count Triplets with Even XOR Set Bits I/README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,40 @@ tags:
99

1010
<!-- problem:start -->
1111

12-
# [3199. Count Triplets with Even XOR Set Bits I 🔒](https://leetcode.cn/problems/count-triplets-with-even-xor-set-bits-i)
12+
# [3199. 用偶数异或设置位计数三元组 I 🔒](https://leetcode.cn/problems/count-triplets-with-even-xor-set-bits-i)
1313

1414
[English Version](/solution/3100-3199/3199.Count%20Triplets%20with%20Even%20XOR%20Set%20Bits%20I/README_EN.md)
1515

1616
## 题目描述
1717

1818
<!-- description:start -->
1919

20-
Given three integer arrays <code>a</code>, <code>b</code>, and <code>c</code>, return the number of triplets <code>(a[i], b[j], c[k])</code>, such that the bitwise <code>XOR</code> of the elements of each triplet has an <strong>even</strong> number of <span data-keyword="set-bit">set bits</span>.
20+
<p>给定三个整数数组&nbsp;<code>a</code><code>b</code>&nbsp;&nbsp;<code>c</code>,返回组内元素按位&nbsp;<code>XOR</code>&nbsp;&nbsp;<strong>偶数</strong>&nbsp;<span data-keyword="set-bit">设置位</span> 的三元组&nbsp;<code>(a[i], b[j], c[k])</code>&nbsp;的数量。</p>
2121

2222
<p>&nbsp;</p>
23-
<p><strong class="example">Example 1:</strong></p>
23+
24+
<p><strong class="example">示例 1:</strong></p>
2425

2526
<div class="example-block">
26-
<p><strong>Input:</strong> <span class="example-io">a = [1], b = [2], c = [3]</span></p>
27+
<p><span class="example-io"><b>输入:</b>a = [1], b = [2], c = [3]</span></p>
2728

28-
<p><strong>Output:</strong> <span class="example-io">1</span></p>
29+
<p><strong>输出:</strong><span class="example-io">1</span></p>
2930

30-
<p><strong>Explanation:</strong></p>
31+
<p><strong>解释:</strong></p>
3132

32-
<p>The only triplet is <code>(a[0], b[0], c[0])</code> and their <code>XOR</code> is: <code>1 XOR 2 XOR 3 = 00<sub>2</sub></code>.</p>
33+
<p>只有一个三元组&nbsp;<code>(a[0], b[0], c[0])</code>&nbsp;并且它们的&nbsp;<code>XOR</code>&nbsp;为:<code>1 XOR 2 XOR 3 = 00<sub>2</sub></code></p>
3334
</div>
3435

35-
<p><strong class="example">Example 2:</strong></p>
36+
<p><strong class="example">示例 2:</strong></p>
3637

3738
<div class="example-block">
38-
<p><strong>Input:</strong> <span class="example-io">a = [1,1], b = [2,3], c = [1,5]</span></p>
39+
<p><span class="example-io"><b>输入:</b></span><span class="example-io">a = [1,1], b = [2,3], c = [1,5]</span></p>
3940

40-
<p><strong>Output:</strong> <span class="example-io">4</span></p>
41+
<p><strong>输出:</strong><span class="example-io">4</span></p>
4142

42-
<p><strong>Explanation:</strong></p>
43+
<p><strong>解释:</strong></p>
4344

44-
<p>Consider these four triplets:</p>
45+
<p>考虑以下 4 个三元组:</p>
4546

4647
<ul>
4748
<li><code>(a[0], b[1], c[0])</code>: <code>1 XOR 3 XOR 1 = 011<sub>2</sub></code></li>
@@ -52,7 +53,8 @@ Given three integer arrays <code>a</code>, <code>b</code>, and <code>c</code>, r
5253
</div>
5354

5455
<p>&nbsp;</p>
55-
<p><strong>Constraints:</strong></p>
56+
57+
<p><strong>提示:</strong></p>
5658

5759
<ul>
5860
<li><code>1 &lt;= a.length, b.length, c.length &lt;= 100</code></li>

solution/3200-3299/3205.Maximum Array Hopping Score I/README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,54 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3205.Ma
66

77
<!-- problem:start -->
88

9-
# [3205. Maximum Array Hopping Score I 🔒](https://leetcode.cn/problems/maximum-array-hopping-score-i)
9+
# [3205. 最大数组跳跃得分 I 🔒](https://leetcode.cn/problems/maximum-array-hopping-score-i)
1010

1111
[English Version](/solution/3200-3299/3205.Maximum%20Array%20Hopping%20Score%20I/README_EN.md)
1212

1313
## 题目描述
1414

1515
<!-- description:start -->
1616

17-
<p>Given an array <code>nums</code>, you have to get the <strong>maximum</strong> score starting from index 0 and <strong>hopping</strong> until you reach the last element of the array.</p>
17+
<p>给定一个数组&nbsp;<code>nums</code>,你必须从索引 0 开始跳跃,直到到达数组的最后一个元素,使得获取 <strong>最大</strong> 分数。</p>
1818

19-
<p>In each <strong>hop</strong>, you can jump from index <code>i</code> to an index <code>j &gt; i</code>, and you get a <strong>score</strong> of <code>(j - i) * nums[j]</code>.</p>
19+
<p>每一次 <strong>跳跃</strong> 中,你可以从下标&nbsp;<code>i</code>&nbsp;跳到一个&nbsp;<code>j &gt; i</code>&nbsp;的下标,并且可以得到&nbsp;<code>(j - i) * nums[j]</code>&nbsp;的分数。</p>
2020

21-
<p>Return the <em>maximum score</em> you can get.</p>
21+
<p>返回你能够取得的最大分数。</p>
2222

2323
<p>&nbsp;</p>
24-
<p><strong class="example">Example 1:</strong></p>
24+
25+
<p><strong class="example">示例 1:</strong></p>
2526

2627
<div class="example-block">
27-
<p><strong>Input:</strong> <span class="example-io">nums = [1,5,8]</span></p>
28+
<p><span class="example-io"><b>输入:</b></span><span class="example-io">nums = [1,5,8]</span></p>
2829

29-
<p><strong>Output:</strong> <span class="example-io">16</span></p>
30+
<p><span class="example-io"><b>输出:</b>16</span></p>
3031

31-
<p><strong>Explanation:</strong></p>
32+
<p><strong>解释:</strong></p>
3233

33-
<p>There are two possible ways to reach the last element:</p>
34+
<p>有两种可能的方法可以到达最后一个元素:</p>
3435

3536
<ul>
36-
<li><code>0 -&gt; 1 -&gt; 2</code> with a score of&nbsp;<code>(1 - 0) * 5 + (2 - 1) * 8 = 13</code>.</li>
37-
<li><code>0 -&gt; 2</code> with a score of&nbsp;<code>(2 - 0) * 8 =&nbsp;16</code>.</li>
37+
<li><code>0 -&gt; 1 -&gt; 2</code> 得分为&nbsp;<code>(1 - 0) * 5 + (2 - 1) * 8 = 13</code></li>
38+
<li><code>0 -&gt; 2</code> 得分为&nbsp;<code>(2 - 0) * 8 =&nbsp;16</code></li>
3839
</ul>
3940
</div>
4041

41-
<p><strong class="example">Example 2:</strong></p>
42+
<p><strong class="example">示例 2:</strong></p>
4243

4344
<div class="example-block">
44-
<p><strong>Input:</strong> <span class="example-io">nums = [4,5,2,8,9,1,3]</span></p>
45+
<p><span class="example-io"><b>输入:</b>nums = [4,5,2,8,9,1,3]</span></p>
4546

46-
<p><strong>Output:</strong> <span class="example-io">42</span></p>
47+
<p><span class="example-io"><b>输出:</b>42</span></p>
4748

48-
<p><strong>Explanation:</strong></p>
49+
<p><strong>解释:</strong></p>
4950

50-
<p>We can do the hopping <code>0 -&gt; 4 -&gt; 6</code> with a score of&nbsp;<code>(4 - 0) * 9 + (6 - 4) * 3 = 42</code>.</p>
51+
<p>我们可以按&nbsp;<code>0 -&gt; 4 -&gt; 6</code>&nbsp;进行跳跃,得分为&nbsp;<code>(4 - 0) * 9 + (6 - 4) * 3 = 42</code></p>
5152
</div>
5253

5354
<p>&nbsp;</p>
54-
<p><strong>Constraints:</strong></p>
55+
56+
<p><strong>提示:</strong></p>
5557

5658
<ul>
5759
<li><code>2 &lt;= nums.length &lt;= 10<sup>3</sup></code></li>

solution/CONTEST_README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ comments: true
2828

2929
#### 第 404 场周赛(2024-06-30 10:30, 90 分钟) 参赛人数 3485
3030

31+
- [3200. 三角形的最大高度](/solution/3200-3299/3200.Maximum%20Height%20of%20a%20Triangle/README.md)
32+
- [3201. 找出有效子序列的最大长度 I](/solution/3200-3299/3201.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20I/README.md)
33+
- [3202. 找出有效子序列的最大长度 II](/solution/3200-3299/3202.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20II/README.md)
34+
- [3203. 合并两棵树后的最小直径](/solution/3200-3299/3203.Find%20Minimum%20Diameter%20After%20Merging%20Two%20Trees/README.md)
3135

3236
#### 第 403 场周赛(2024-06-23 10:30, 90 分钟) 参赛人数 3112
3337

3438
- [3194. 最小元素和最大元素的最小平均值](/solution/3100-3199/3194.Minimum%20Average%20of%20Smallest%20and%20Largest%20Elements/README.md)
3539
- [3195. 包含所有 1 的最小矩形面积 I](/solution/3100-3199/3195.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20I/README.md)
40+
- [3196. 最大化子数组的总成本](/solution/3100-3199/3196.Maximize%20Total%20Cost%20of%20Alternating%20Subarrays/README.md)
41+
- [3197. 包含所有 1 的最小矩形面积 II](/solution/3100-3199/3197.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20II/README.md)
3642

3743
#### 第 133 场双周赛(2024-06-22 22:30, 90 分钟) 参赛人数 2326
3844

solution/CONTEST_README_EN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ If you want to estimate your score changes after the contest ends, you can visit
3131

3232
#### Weekly Contest 404
3333

34+
- [3200. Maximum Height of a Triangle](/solution/3200-3299/3200.Maximum%20Height%20of%20a%20Triangle/README_EN.md)
35+
- [3201. Find the Maximum Length of Valid Subsequence I](/solution/3200-3299/3201.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20I/README_EN.md)
36+
- [3202. Find the Maximum Length of Valid Subsequence II](/solution/3200-3299/3202.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20II/README_EN.md)
37+
- [3203. Find Minimum Diameter After Merging Two Trees](/solution/3200-3299/3203.Find%20Minimum%20Diameter%20After%20Merging%20Two%20Trees/README_EN.md)
3438

3539
#### Weekly Contest 403
3640

3741
- [3194. Minimum Average of Smallest and Largest Elements](/solution/3100-3199/3194.Minimum%20Average%20of%20Smallest%20and%20Largest%20Elements/README_EN.md)
3842
- [3195. Find the Minimum Area to Cover All Ones I](/solution/3100-3199/3195.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20I/README_EN.md)
43+
- [3196. Maximize Total Cost of Alternating Subarrays](/solution/3100-3199/3196.Maximize%20Total%20Cost%20of%20Alternating%20Subarrays/README_EN.md)
44+
- [3197. Find the Minimum Area to Cover All Ones II](/solution/3100-3199/3197.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20II/README_EN.md)
3945

4046
#### Biweekly Contest 133
4147

solution/DATABASE_README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@
284284
| 3172 | [第二天验证](/solution/3100-3199/3172.Second%20Day%20Verification/README.md) | `数据库` | 简单 | 🔒 |
285285
| 3182 | [查找得分最高的学生](/solution/3100-3199/3182.Find%20Top%20Scoring%20Students/README.md) | `数据库` | 中等 | 🔒 |
286286
| 3188 | [查找得分最高的学生 II](/solution/3100-3199/3188.Find%20Top%20Scoring%20Students%20II/README.md) | `数据库` | 困难 | 🔒 |
287+
| 3198 | [查找每个州的城市](/solution/3100-3199/3198.Find%20Cities%20in%20Each%20State/README.md) | `数据库` | 简单 | 🔒 |
288+
| 3204 | [按位用户权限分析](/solution/3200-3299/3204.Bitwise%20User%20Permissions%20Analysis/README.md) | `数据库` | 中等 | 🔒 |
287289

288290
## 版权
289291

solution/DATABASE_README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
282282
| 3172 | [Second Day Verification](/solution/3100-3199/3172.Second%20Day%20Verification/README_EN.md) | `Database` | Easy | 🔒 |
283283
| 3182 | [Find Top Scoring Students](/solution/3100-3199/3182.Find%20Top%20Scoring%20Students/README_EN.md) | `Database` | Medium | 🔒 |
284284
| 3188 | [Find Top Scoring Students II](/solution/3100-3199/3188.Find%20Top%20Scoring%20Students%20II/README_EN.md) | `Database` | Hard | 🔒 |
285+
| 3198 | [Find Cities in Each State](/solution/3100-3199/3198.Find%20Cities%20in%20Each%20State/README_EN.md) | `Database` | Easy | 🔒 |
286+
| 3204 | [Bitwise User Permissions Analysis](/solution/3200-3299/3204.Bitwise%20User%20Permissions%20Analysis/README_EN.md) | `Database` | Medium | 🔒 |
285287

286288
## Copyright
287289

solution/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,6 +3206,16 @@
32063206
| 3193 | [统计逆序对的数目](/solution/3100-3199/3193.Count%20the%20Number%20of%20Inversions/README.md) | `数组`,`动态规划` | 困难 | 第 133 场双周赛 |
32073207
| 3194 | [最小元素和最大元素的最小平均值](/solution/3100-3199/3194.Minimum%20Average%20of%20Smallest%20and%20Largest%20Elements/README.md) | `数组`,`双指针`,`排序` | 简单 | 第 403 场周赛 |
32083208
| 3195 | [包含所有 1 的最小矩形面积 I](/solution/3100-3199/3195.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20I/README.md) | `数组`,`矩阵` | 中等 | 第 403 场周赛 |
3209+
| 3196 | [最大化子数组的总成本](/solution/3100-3199/3196.Maximize%20Total%20Cost%20of%20Alternating%20Subarrays/README.md) | `数组`,`动态规划` | 中等 | 第 403 场周赛 |
3210+
| 3197 | [包含所有 1 的最小矩形面积 II](/solution/3100-3199/3197.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20II/README.md) | `数组`,`枚举`,`矩阵` | 困难 | 第 403 场周赛 |
3211+
| 3198 | [查找每个州的城市](/solution/3100-3199/3198.Find%20Cities%20in%20Each%20State/README.md) | `数据库` | 简单 | 🔒 |
3212+
| 3199 | [用偶数异或设置位计数三元组 I](/solution/3100-3199/3199.Count%20Triplets%20with%20Even%20XOR%20Set%20Bits%20I/README.md) | `位运算`,`数组` | 简单 | 🔒 |
3213+
| 3200 | [三角形的最大高度](/solution/3200-3299/3200.Maximum%20Height%20of%20a%20Triangle/README.md) | `数组`,`枚举` | 简单 | 第 404 场周赛 |
3214+
| 3201 | [找出有效子序列的最大长度 I](/solution/3200-3299/3201.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20I/README.md) | `数组`,`动态规划` | 中等 | 第 404 场周赛 |
3215+
| 3202 | [找出有效子序列的最大长度 II](/solution/3200-3299/3202.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20II/README.md) | `数组`,`动态规划` | 中等 | 第 404 场周赛 |
3216+
| 3203 | [合并两棵树后的最小直径](/solution/3200-3299/3203.Find%20Minimum%20Diameter%20After%20Merging%20Two%20Trees/README.md) | `树`,`深度优先搜索`,`广度优先搜索`,`图` | 困难 | 第 404 场周赛 |
3217+
| 3204 | [按位用户权限分析](/solution/3200-3299/3204.Bitwise%20User%20Permissions%20Analysis/README.md) | `数据库` | 中等 | 🔒 |
3218+
| 3205 | [最大数组跳跃得分 I](/solution/3200-3299/3205.Maximum%20Array%20Hopping%20Score%20I/README.md) | | 中等 | 🔒 |
32093219

32103220
## 版权
32113221

solution/README_EN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,16 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
32043204
| 3193 | [Count the Number of Inversions](/solution/3100-3199/3193.Count%20the%20Number%20of%20Inversions/README_EN.md) | `Array`,`Dynamic Programming` | Hard | Biweekly Contest 133 |
32053205
| 3194 | [Minimum Average of Smallest and Largest Elements](/solution/3100-3199/3194.Minimum%20Average%20of%20Smallest%20and%20Largest%20Elements/README_EN.md) | `Array`,`Two Pointers`,`Sorting` | Easy | Weekly Contest 403 |
32063206
| 3195 | [Find the Minimum Area to Cover All Ones I](/solution/3100-3199/3195.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20I/README_EN.md) | `Array`,`Matrix` | Medium | Weekly Contest 403 |
3207+
| 3196 | [Maximize Total Cost of Alternating Subarrays](/solution/3100-3199/3196.Maximize%20Total%20Cost%20of%20Alternating%20Subarrays/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 403 |
3208+
| 3197 | [Find the Minimum Area to Cover All Ones II](/solution/3100-3199/3197.Find%20the%20Minimum%20Area%20to%20Cover%20All%20Ones%20II/README_EN.md) | `Array`,`Enumeration`,`Matrix` | Hard | Weekly Contest 403 |
3209+
| 3198 | [Find Cities in Each State](/solution/3100-3199/3198.Find%20Cities%20in%20Each%20State/README_EN.md) | `Database` | Easy | 🔒 |
3210+
| 3199 | [Count Triplets with Even XOR Set Bits I](/solution/3100-3199/3199.Count%20Triplets%20with%20Even%20XOR%20Set%20Bits%20I/README_EN.md) | `Bit Manipulation`,`Array` | Easy | 🔒 |
3211+
| 3200 | [Maximum Height of a Triangle](/solution/3200-3299/3200.Maximum%20Height%20of%20a%20Triangle/README_EN.md) | `Array`,`Enumeration` | Easy | Weekly Contest 404 |
3212+
| 3201 | [Find the Maximum Length of Valid Subsequence I](/solution/3200-3299/3201.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20I/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 404 |
3213+
| 3202 | [Find the Maximum Length of Valid Subsequence II](/solution/3200-3299/3202.Find%20the%20Maximum%20Length%20of%20Valid%20Subsequence%20II/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 404 |
3214+
| 3203 | [Find Minimum Diameter After Merging Two Trees](/solution/3200-3299/3203.Find%20Minimum%20Diameter%20After%20Merging%20Two%20Trees/README_EN.md) | `Tree`,`Depth-First Search`,`Breadth-First Search`,`Graph` | Hard | Weekly Contest 404 |
3215+
| 3204 | [Bitwise User Permissions Analysis](/solution/3200-3299/3204.Bitwise%20User%20Permissions%20Analysis/README_EN.md) | `Database` | Medium | 🔒 |
3216+
| 3205 | [Maximum Array Hopping Score I](/solution/3200-3299/3205.Maximum%20Array%20Hopping%20Score%20I/README_EN.md) | | Medium | 🔒 |
32073217

32083218
## Copyright
32093219

solution/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def run():
446446
except:
447447
slug = q["titleSlug"]
448448
qid = int(q["frontendQuestionId"])
449-
if slug in question_details:
449+
if slug in question_details and qid < 3000:
450450
continue
451451
detail = spider.get_question_detail(
452452
slug, retry=4

0 commit comments

Comments
 (0)