OSDN Git Service
(root)
/
oi-wiki
/
main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5333654
)
Update docs/topic/bracket.md
author
mgt
<i@margatroid.xyz>
Mon, 14 Dec 2020 09:12:12 +0000
(17:12 +0800)
committer
GitHub
<noreply@github.com>
Mon, 14 Dec 2020 09:12:12 +0000
(17:12 +0800)
Co-authored-by: Xeonacid <h.dwwwwww@gmail.com>
docs/topic/bracket.md
patch
|
blob
|
history
diff --git
a/docs/topic/bracket.md
b/docs/topic/bracket.md
index
5e7d683
..
11690dc
100644
(file)
--- a/
docs/topic/bracket.md
+++ b/
docs/topic/bracket.md
@@
-39,7
+39,7
@@
$$
## 字典序后继
-给出合法的括号序列 $s$ ,我们要求出
(将长度为 $|s|$ 的所有合法括号序列)按字典序从小到大排序后 $s$ 的下一个合法括号序列,我们认为左括号的字典序小于右括号。在本问题中我们
不考虑变种括号序列。
+给出合法的括号序列 $s$ ,我们要求出
按字典序升序排序的长度为 $|s|$ 的所有合法括号序列中,序列 $s$ 的下一个合法括号序列。在本问题中,我们认为左括号的字典序小于右括号,且
不考虑变种括号序列。
我们需要找到一个最大的 $i$ 使得 $s_i$ 是左括号。然后,将其变成右括号,并将 $s[i+1,|s|]$ 这部分重构一下。另外, $i$ 必须满足: $s[1,i-1]$ 中左括号的数量 **大于** 右括号的数量。