对固定的右端点 r,设每个值在前缀 [1,r] 内的最后一次出现位置为 lastr[v]。 那么一个值 v 会出现在 [l,r] 中,当且仅当 lastr[v]≥l。 因此
钟师在远古祭坛铺设了 n 口钟阵,每口钟的编号记录在数组 {a1,a2,...,an} 中;
对任意区间 [l,r] ,记钟面编号差 △面=ar−al ,并令 g(l,r) 表示区间内不同钟声的种类数;
于是区间的净余谐振能量定义为
Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册