結果

問題 No.862 XORでX
ユーザー vwxyzvwxyz
提出日時 2024-04-08 03:46:54
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 582 bytes
コンパイル時間 3,280 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 93,676 KB
最終ジャッジ日時 2024-04-08 03:47:49
合計ジャッジ時間 11,716 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
57,300 KB
testcase_01 AC 43 ms
57,300 KB
testcase_02 AC 39 ms
57,300 KB
testcase_03 AC 39 ms
57,300 KB
testcase_04 AC 40 ms
57,300 KB
testcase_05 AC 39 ms
57,300 KB
testcase_06 AC 40 ms
57,300 KB
testcase_07 AC 39 ms
57,300 KB
testcase_08 AC 55 ms
69,020 KB
testcase_09 AC 52 ms
69,020 KB
testcase_10 AC 56 ms
69,020 KB
testcase_11 AC 71 ms
69,020 KB
testcase_12 AC 40 ms
57,300 KB
testcase_13 AC 40 ms
57,300 KB
testcase_14 AC 40 ms
57,300 KB
testcase_15 AC 40 ms
57,300 KB
testcase_16 AC 82 ms
89,292 KB
testcase_17 AC 80 ms
89,292 KB
testcase_18 AC 76 ms
89,288 KB
testcase_19 AC 77 ms
89,288 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 83 ms
93,200 KB
testcase_25 AC 84 ms
93,204 KB
testcase_26 AC 84 ms
93,276 KB
testcase_27 AC 86 ms
93,152 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 84 ms
93,152 KB
testcase_31 AC 85 ms
93,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X=map(int,input().split())
M=10**5
if X>=2:
    if N%4==0:
        ans_lst=[X,1,2,3]
    elif N%4==1:
        ans_lst=[X]
    elif N%4==2:
        ans_lst=[X^1,1]
    else:
        ans_lst=[X^1,2,3]
else:
    if N%4==0:
        ans_lst=[1,2,4,6]
    elif N%4==1:
        ans_lst=[1]
    elif N%4==2:
        ans_lst=[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