CodeForces 665E. Beautiful Subarrays(字典树)(贪心)(异或前缀和)
摘要:题意:给定一个长度为n(1 ⇐ n ⇐ 1e6)的数组a[i](0 ⇐ a[i] ⇐ 1e9)和k(1 ⇐ k ⇐ 1e9)。求有多少个区间[l, r]是合法的。我们认为一个区间是合法的,当且仅当$a[l]\oplus a[l + 1]\oplus a[l + 2] \oplus ... a[r]
阅读全文
D. Dr. Evil Underscores
摘要:题意:今天,作为一个友谊礼物,Bakry给予Badawy n个整数a1,a2,...,an,让他去寻找一个数X,使得$\underset{1 \leq i \leq n}{\max} (a_i \oplus X)$最小。 输入: 第一行是一个整数n(1 include include include
阅读全文