Skip to content

Commit a6e2503

Browse files
committed
upd
1 parent 1641d25 commit a6e2503

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: copypasta/trie01.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ package copypasta
33
import (
44
"math"
55
"math/bits"
6+
"runtime/debug"
67
)
78

8-
// 注:由于用的是指针写法,必要时禁止 GC,能加速不少
9-
// func init() { debug.SetGCPercent(-1) }
10-
119
// 异或字典树
1210
// 一棵(所有叶节点深度都相同的)二叉树
1311
// 模板题 LC421 https://leetcode.cn/problems/maximum-xor-of-two-numbers-in-an-array/
@@ -23,6 +21,10 @@ import (
2321
// 转换 https://codeforces.com/contest/1720/problem/D2
2422
// 异或和 ≥k 的最短区间 https://acm.hdu.edu.cn/showproblem.php?pid=6955
2523
// https://codeforces.com/problemset/problem/1849/F
24+
25+
// 指针写法关闭 GC 可以得到明显加速
26+
func init() { debug.SetGCPercent(-1) }
27+
2628
type trie01Node struct {
2729
son [2]*trie01Node
2830
cnt int // 子树叶子数

0 commit comments

Comments
 (0)