結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
57,300 KB
testcase_01 AC 39 ms
57,300 KB
testcase_02 AC 40 ms
57,300 KB
testcase_03 AC 38 ms
57,300 KB
testcase_04 AC 38 ms
57,300 KB
testcase_05 AC 38 ms
57,300 KB
testcase_06 AC 38 ms
57,300 KB
testcase_07 AC 37 ms
57,300 KB
testcase_08 AC 51 ms
68,812 KB
testcase_09 AC 51 ms
68,812 KB
testcase_10 AC 73 ms
68,812 KB
testcase_11 AC 71 ms
68,812 KB
testcase_12 AC 38 ms
57,300 KB
testcase_13 AC 39 ms
57,300 KB
testcase_14 AC 39 ms
57,300 KB
testcase_15 AC 37 ms
57,300 KB
testcase_16 AC 80 ms
89,192 KB
testcase_17 AC 93 ms
89,192 KB
testcase_18 AC 78 ms
89,192 KB
testcase_19 AC 78 ms
89,180 KB
testcase_20 AC 95 ms
92,984 KB
testcase_21 AC 88 ms
92,980 KB
testcase_22 AC 84 ms
92,980 KB
testcase_23 AC 84 ms
92,976 KB
testcase_24 AC 85 ms
93,132 KB
testcase_25 AC 84 ms
93,032 KB
testcase_26 AC 83 ms
92,976 KB
testcase_27 AC 106 ms
92,976 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 83 ms
92,980 KB
testcase_31 AC 104 ms
92,980 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(4,M+3,2):
    if len(ans_lst)<N and not m in ans_lst[:5] and not m+1 in ans_lst[:10]:
        ans_lst.append(m)
        ans_lst.append(m+1)
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