問題一覧 > 通常問題

No.1569 Nixoracci's Number

レベル : / AI推定難易度 : 675 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 110
作問者 : 8UqsVg4r / テスター : maguro blackyuki PCTprobability
お気に入りにしたユーザー ProblemId : 6334 / 自分の提出
問題文最終更新日: 2021-06-27 08:49:44
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
灘校文化祭コンテスト 2021 day2 (順位表) の他の問題:

Problem Statement

There is a sequence $A$ whose first $N$ elements are given. The terms of $A$ from the $N+1$-th onward are defined as follows.

  • $A_x=A_{x-1}\ \mathrm{xor}\ A_{x-2}\ \mathrm{xor}\ \dots \mathrm{xor}\ A_{x-N}\ (x \ge N+1)$

Find $A_K$.

Here, $\mathrm{xor}$ in the problem statement denotes the bitwise exclusive OR.

Input

$N\ K$
$A_1\ A_2\ \dots \ A_N$

  • All inputs are integers.
  • $2 \leq N \leq 200$
  • $1 \leq K \leq 10^{18}$
  • $0 \leq A_i \leq 10^{18} (1 \leq i \leq N)$

Output

Output the value of $A_K$.

Sample

Sample 1
Input
2 3
0 1
Output
1

Since $A_3 =0\ xor\ 1 = 1$, output $1$.

Sample 2
Input
4 5
2 5 6 4
Output
5

Sample 3
Input
5 9
9 2 4 3 6
Output
4

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。