如果您使用 unordered_map\texttt{ unordered\_map} unordered_map ,并且使用 clear()\texttt{clear()}clear() 函数来清空其的话,请不要通过 [v]\texttt{[v]}[v] 运算符来判断 v\texttt{v}v 是否在容器内,否则 unordered_map\texttt{ unordered\_map} unordered_map 会自动创建 key_word 为 v\texttt{v}v 的元素,导致 clear()\texttt{clear()}clear() 函数的复杂度不与当前子树大小相关。
QAQ