Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f82a91

Browse files
author
杨世超
committed
更新文章代码格式
1 parent946591d commit6f82a91

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

‎Contents/07.Tree/03.Segment-Tree/01.Segment-Tree.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class SegmentTree:
322322
right_size= (self.tree[right_index].right-self.tree[right_index].left+1)
323323
self.tree[right_index].val+= lazy_tag* right_size# 右子节点每个元素值增加 lazy_tag
324324

325-
self.tree[index].lazy_tag=None# 更新当前节点的懒惰标记
325+
self.tree[index].lazy_tag=None# 更新当前节点的懒惰标记
326326
```
327327

328328
##4. 线段树的常见题型

‎Contents/08.Graph/01.Graph-Basic/02.Graph-Structure.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class EdgeNode: # 边信息类
123123

124124
classGraph:# 基本图类,采用边集数组表示
125125
def__init__(self):
126-
self.edges= []# 边数组
126+
self.edges= []# 边数组
127127

128128
# 图的创建操作,edges 为边信息
129129
defcreatGraph(self,edges=[]):

‎Solutions/0090. 子集 II.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
**示例**
1919

2020
```Python
21-
输入nums= [1,2,2]
22-
输出[[],[1],[1,2],[1,2,2],[2],[2,2]]
21+
输入nums= [1,2,2]
22+
输出[[],[1],[1,2],[1,2,2],[2],[2,2]]
2323
```
2424

2525
##解题思路
@@ -76,22 +76,22 @@ class Solution:
7676

7777
| 集合 nums 对应位置(下标)| 4| 3| 2| 1| 0|
7878
| :-------------------------| :--:| :--:| :--:| :--:| :--:|
79-
| 对应选取状态| 选取| 选取| 选取| 选取| 选取|
8079
| 二进制数对应位数| 1| 1| 1| 1| 1|
80+
| 对应选取状态| 选取| 选取| 选取| 选取| 选取|
8181

8282
再比如二进制数`10101` 就表示选取集合的第`0` 位、第`2` 位、第`5` 位元素,也就是集合`{5, 3, 1}`。如下表所示:
8383

8484
| 集合 nums 对应位置(下标)| 4| 3| 2| 1| 0|
8585
| :-------------------------| :--:| :----:| :--:| :----:| :--:|
86-
| 对应选取状态| 选取| 未选取| 选取| 未选取| 选取|
8786
| 二进制数对应位数| 1| 0| 1| 0| 1|
87+
| 对应选取状态| 选取| 未选取| 选取| 未选取| 选取|
8888

8989
再比如二进制数`01001` 就表示选取集合的第`0` 位、第`3` 位元素,也就是集合`{5, 2}`。如下标所示:
9090

9191
| 集合 nums 对应位置(下标)| 4| 3| 2| 1| 0|
9292
| :-------------------------| :----:| :--:| :----:| :----:| :--:|
93-
| 对应选取状态| 未选取| 选取| 未选取| 未选取| 选取|
9493
| 二进制数对应位数| 0| 1| 0| 0| 1|
94+
| 对应选取状态| 未选取| 选取| 未选取| 未选取| 选取|
9595

9696
通过上面的例子我们可以得到启发:对于长度为`5` 的集合`nums` 来说,我们只需要从`00000` ~`11111` 枚举一次(对应十进制为 $0 \sim 2^4 - 1$)即可得到长度为`5` 的集合`S` 的所有子集。
9797

‎Solutions/1281. 整数的各位积和之差.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
**示例**
1717

1818
```Python
19-
给定 n=234
20-
输出15
19+
给定n=234
20+
输出15
2121

22-
解释
22+
解释
2323
各位数之积2*3*4=24
2424
各位数之和2+3+4=9
2525
结果24-9=15

‎Solutions/1450. 在既定时间做作业的学生人数.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
**示例**
2020

2121
```Python
22-
输入startTime= [4], endTime= [4], queryTime=4
23-
输出1
24-
解释在查询时间只有一名学生在做作业。
22+
输入startTime= [4], endTime= [4], queryTime=4
23+
输出1
24+
解释在查询时间只有一名学生在做作业。
2525
```
2626

2727
##解题思路

‎Solutions/剑指 Offer 57 - II. 和为s的连续正数序列.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
**示例**
1717

1818
```Python
19-
输入target=9
20-
输出[[2,3,4],[4,5]]
19+
输入target=9
20+
输出[[2,3,4],[4,5]]
2121
```
2222

2323
##解题思路

‎Templates/08.Graph/Graph-Bellman-Ford.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def bellmanFord(self, graph, source):
3030
'e': {'d':-3}
3131
}
3232
dist=Solution().bellmanFord(graph,'a')
33-
print(dist)
33+
print(dist)

‎Templates/08.Graph/Graph-Edgeset-Array.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def __init__(self, vi, vj, val):
66

77
classGraph:# 基本图类,采用边集数组表示
88
def__init__(self):
9-
self.edges= []# 边数组
9+
self.edges= []# 边数组
1010

1111
# 图的创建操作,edges 为边信息
1212
defcreatGraph(self,edges=[]):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp