CF1732C Sheikh (easy & hard) 题解

传送门:Sheikh

给定一串长度为$n(1 \leq n \leq 10^5)$的数列$a1, a_2, \ldots, a_n\left(0 \leq a_i \leq 10^9\right)$,定义$f(l, r)=\operatorname{sum}(l, r)-\operatorname{xor}(l, r)$,其中$\operatorname{sum}(l, r)=a_l+a{l+1}+\ldots+ar$,$\operatorname{xor}(l, r)=a_l \oplus a{l+1} \oplus \ldots \oplus a_r$,一共有$q$次询问,每次询问会给定一个区间,询问这个区间内满足$f$最大的最短的子段。

Read more
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×