結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,112 KB
testcase_01 AC 34 ms
10,112 KB
testcase_02 AC 33 ms
10,112 KB
testcase_03 AC 37 ms
10,112 KB
testcase_04 AC 34 ms
10,112 KB
testcase_05 AC 34 ms
10,112 KB
testcase_06 AC 32 ms
10,112 KB
testcase_07 RE -
testcase_08 AC 42 ms
11,264 KB
testcase_09 AC 42 ms
11,264 KB
testcase_10 AC 47 ms
11,264 KB
testcase_11 AC 50 ms
11,264 KB
testcase_12 AC 34 ms
10,112 KB
testcase_13 AC 34 ms
10,112 KB
testcase_14 AC 33 ms
10,112 KB
testcase_15 AC 32 ms
10,112 KB
testcase_16 AC 94 ms
15,696 KB
testcase_17 AC 97 ms
15,696 KB
testcase_18 AC 93 ms
15,696 KB
testcase_19 AC 108 ms
15,696 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 118 ms
20,800 KB
testcase_25 AC 119 ms
20,800 KB
testcase_26 AC 118 ms
20,800 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 120 ms
20,800 KB
testcase_31 AC 126 ms
20,800 KB
権限があれば一括ダウンロードができます

ソースコード

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