#14749. [Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)

[Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)

[Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)

题目描述

给定序列 $a_1,\dots,a_n$,共 $m$ 次询问,每次询问给出 $l,r$,查询所有满足 $l\le L\le R\le r$ 的 $(L,R)$ 的权值的按位异或和,二元组 $(L,R)$ 的权值是 $|\{a_i\mid L\le i\le R\}|$。

输入格式

第一行两个整数 $n\ m$;

接下来一行 nn 个整数 a1,…,ana_1,\dots,a_n;

接下来 mm 行,每行两个整数 l rl\ r 表示一次查询。

输出格式

输出 $m$ 行,依次表示每个询问的答案。
5 2
1 1 1 2 4
1 5
3 5
3
2

提示

Idea:nzhtl1477,Solution:ccz181078,Code:ccz181078,Data:ccz181078

对于 5%5\% 的数据,满足 1≤n,m≤1001\le n,m\le 100。

对于 10%10\% 的数据,满足 1≤n,m≤50001\le n,m\le 5000。

对于 20%20\% 的数据,满足 1≤n,m≤1051\le n,m\le 10^5。

对于 30%30\% 的数据,满足 1≤n,m≤2×1051\le n,m\le 2\times 10^5。

对于 40%40\% 的数据,满足 1≤n,m≤3×1051\le n,m\le 3\times 10^5。

对于 50%50\% 的数据,满足 1≤n,m≤3.5×1051\le n,m\le 3.5\times 10^5。

对于另外 10%10\% 的数据,满足 m=n2m=n^2。

对于另外 10%10\% 的数据,满足对任意 i=1⋯ni=1\cdots n,ai≤2a_i\le 2。

对于另外 10%10\% 的数据,满足对任意 i=1⋯ni=1\cdots n,ai≤10a_i\le 10。

对于 100%100\% 的数据,满足 1≤n,m≤4×1051\le n,m\le 4\times 10^5,1≤ai≤n1\le a_i\le n,所有数值为整数。 标签: P8526|O2优化|Ynoi|2078

来源

P8526|[Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)