Update 树状数组+kmp