結果

問題 No.862 XORでX
ユーザー vwxyzvwxyz
提出日時 2024-04-08 03:40:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 2,381 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 20,764 KB
最終ジャッジ日時 2024-04-08 03:41:46
合計ジャッジ時間 13,619 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 32 ms
10,112 KB
testcase_03 WA -
testcase_04 AC 32 ms
10,112 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X=map(int,input().split())
M=10**5
if N%4==0:
    ans_lst=[X,1,2,3]
elif N%4==1:
    ans_lst=[X]
elif N%4==2:
    if X>=2:
        ans_lst=[X^1,1]
    else:
        ans_lst=[2,3]
else:
    if X>=2:
        ans_lst=[X^1,2,3]
    else:
        ans_lst=[3,4,6]
for m in range(8,M+2,4):
    if len(ans_lst)<N:
        for dm in range(4):
            ans_lst.append(m+dm)
print(*ans_lst,sep="/n")
assert len(ans_lst)==len(set(ans_lst))==N
xor=0
for a in ans_lst:
    xor^=a
assert xor==X
0