問題一覧 > 通常問題

No.1456 Range Xor

レベル : / AI推定難易度 : 600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 162
作問者 : NaHCO314 / テスター : MtSaka
お気に入りにしたユーザー ProblemId : 6083 / 自分の提出
問題文最終更新日: 2021-12-26 01:33:43
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(夜の部) (順位表) の他の問題:

Problem Statement

You are given an integer $K$ and an integer sequence $A$ of length $N$. If there exists a pair $i,j$($1 \leq i \leq j \leq N$) such that $A_i\oplus A_{i+1}\oplus ... \oplus A_j=K$, print Yes; otherwise, print No.
Here, $X\oplus Y$ denotes the bitwise exclusive OR of $X$ and $Y$.

Input

$N\ K$
$A_1\ A_2\ ...\ A_N$

  • All inputs are integers.
  • $ 1 \leq N \leq 10^5$
  • $ 0 \leq A_i,K \leq 10^9$

Output

Print a newline at the end.

Sample

Sample 1
Input
5 11
5 2 8 1 3
Output
Yes

When $i=2,j=4$, we have $2 \oplus 8\oplus 1=K=11$, so the answer is Yes.

Sample 2
Input
10 8
3 1 4 1 5 9 2 6 5 3
Output
Yes

Sample 3
Input
10 10
1 3 5 7 9 11 13 15 17 19
Output
No

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