No.862 X with XOR
レベル :
/ AI推定難易度 : 1500
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : / 解いたユーザー数 50
作問者 :
nmnmnmnmnmnmnm
タグ : / 解いたユーザー数 50
作問者 :
nmnmnmnmnmnmnm
問題文最終更新日: 2019-08-09 22:24:27
English (AI translation)
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
yukicoder contest 219
(順位表)
の他の問題:
Problem Statement
Taking the exclusive OR of all of $N$ distinct positive integers $A_1$, $A_2$, ..., $A_N$ resulted in the positive integer $X$.
Given $N$ and $X$, find positive integers $A_1$, $A_2$, ..., $A_N$ that satisfy the condition.
Input
$N$ $X$
$N$ and $X$ are positive integers. $1 \le N,X \le 100000 = 10^5$.
Output
Output the answer in $N$ lines. On the $i$-th line, output $A_i$.
$A_i$ is a positive integer. $1 \le A_i \le 100005 = 10^5+5$.
Sample
Sample 1
Input
3 6
Output
1 3 4
The exclusive OR of the 3 distinct positive integers 1, 3, and 4 is 6, so the condition is satisfied.
Many other solutions exist as well.
Sample 2
Input
4 5
Output
10 4 8 3
Sample 3
Input
1 100000
Output
100000
Sample 4
Input
2 100000
Output
5 100005
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。