#CF453D. Little Pony and Elements of Harmony
Little Pony and Elements of Harmony
Little Pony and Elements of Harmony
- 时间限制:5 秒
- 内存限制:256 MiB
题目描述
有 个节点,编号为 。节点 在时刻 的能量记为 ,其变化规律为
$$e_i[u]=\sum_{v=0}^{n-1}e_{i-1}[v]\cdot b_{\operatorname{popcount}(u\operatorname{xor}v)}.$$给定初始能量向量 、变换系数 、时刻 与模数 ,求时刻 的能量向量对 取模后的结果。
输入格式
第一行包含三个整数 。
第二行包含 个整数 。
第三行包含 个整数 。
输出格式
输出 行,第 行为 。
样例输入 1
2 2 10000
4 1 2 3
0 1 0
样例输出 1
14
6
6
14
数据范围
对于所有测试数据,保证:
- ,,;,。
| 测试点编号 | 分值 | 特殊限制 |
|---|---|---|
| 且 | ||
| 无 |
每个测试点独立计分。