Codeforces Round #FF (Div. 1)
E
DZY Loves Bridges
Codeforces
3100
原题
← D→
翻译中…

DZY owns $2^{*m*}$ islands near his home, numbered from $1$ to $2^{*m*}$. He loves building bridges to connect the islands. Every bridge he builds takes one day's time to walk across.

翻译中…

DZY has a strange rule of building the bridges. For every pair of islands $*u*, *v* (*u* ≠ *v*)$, he has built $2^{*k*}$ different bridges connecting them, where image ($*a*|*b*$ means $*b*$ is divisible by $*a*$). These bridges are bidirectional.

翻译中…

Also, DZY has built some bridges connecting his home with the islands. Specifically, there are $*a*_{*i*}$ different bridges from his home to the $*i*$-th island. These are one-way bridges, so after he leaves his home he will never come back.

翻译中…

DZY decides to go to the islands for sightseeing. At first he is at home. He chooses and walks across one of the bridges connecting with his home, and arrives at some island. After that, he will spend $*t*$ day(s) on the islands. Each day, he can choose to stay and rest, or to walk to another island across the bridge. It is allowed to stay at an island for more than one day. It's also allowed to cross one bridge more than once.

翻译中…

Suppose that right after the $*t*$-th day DZY stands at the $*i*$-th island. Let $*ans*[*i*]$ be the number of ways for DZY to reach the $*i*$-th island after $*t*$-th day. Your task is to calculate $*ans*[*i*]$ for each $*i*$ modulo $1051131$.

翻译中…

Input

翻译中…

To avoid huge input, we use the following way to generate the array $*a*$. You are given the first $*s*$ elements of array: $*a*_{1}, *a*_{2}, ..., *a*_{*s*}$. All the other elements should be calculated by formula: $*a*_{*i*} = (101·*a*_{*i* - *s*} + 10007) *mod* 1051131$ $(*s* < *i* ≤ 2^{*m*})$.

翻译中…

The first line contains three integers $*m*, *t*, *s*$ $(1 ≤ *m* ≤ 25; 1 ≤ *t* ≤ 10^{18}; 1 ≤ *s* ≤ *min*(2^{*m*}, 10^{5}))$.

翻译中…

The second line contains $*s*$ integers $*a*_{1}, *a*_{2}, ..., *a*_{*s*} (1 ≤ *a*_{*i*} ≤ 10^{6})$.

翻译中…

Output

翻译中…

To avoid huge output, you only need to output xor-sum of all the answers for all $*i*$ modulo $1051131$ $(1 ≤ *i* ≤ 2^{*m*})$, i.e. $(*ans*[1] *mod* 1051131) *xor* (*ans*[2] *mod* 1051131) *xor*... *xor* (*ans*[*n*] *mod* 1051131)$.

翻译中…

Note

翻译中…

In the first sample, $*ans* = [6, 7, 6, 6]$.

翻译中…

If he wants to be at island 1 after one day, he has 6 different ways:

翻译中…
  1. home —> 1 -(stay)-> 1
  2. home —> 2 —> 1
  3. home —> 3 —> 1
  4. home —> 3 —> 1 (note that there are two different bridges between 1 and 3)
  5. home —> 4 —> 1
  6. home —> 4 —> 1 (note that there are two different bridges from home to 4)
翻译中…

In the second sample, $(*a*_{1}, *a*_{2}, *a*_{3}, *a*_{4}, *a*_{5}, *a*_{6}, *a*_{7}, *a*_{8}) = (389094, 705719, 547193, 653800, 947499, 17024, 416654, 861849)$, $*ans* = [235771, 712729, 433182, 745954, 139255, 935785, 620229, 644335]$.

翻译中…

样例

Input #1
2 1 4
1 1 1 2
Output #1
1
InputCopy OutputCopy
Input #2
3 5 6
389094 705719 547193 653800 947499 17024
Output #2
556970
InputCopy OutputCopy
题目信息
题号
446E
时间限制
5 s
内存限制
512 MB
标签
数学
矩阵

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。