結果

問題 No.862 XORでX
ユーザー simamumusimamumu
提出日時 2019-08-09 22:20:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 867 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 14,348 KB
最終ジャッジ日時 2023-09-26 18:21:14
合計ジャッジ時間 6,520 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,116 KB
testcase_01 AC 32 ms
10,032 KB
testcase_02 AC 31 ms
10,060 KB
testcase_03 AC 32 ms
10,092 KB
testcase_04 AC 31 ms
9,976 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 41 ms
10,680 KB
testcase_09 AC 42 ms
10,572 KB
testcase_10 AC 41 ms
10,624 KB
testcase_11 AC 42 ms
10,680 KB
testcase_12 AC 32 ms
10,088 KB
testcase_13 AC 32 ms
10,100 KB
testcase_14 AC 32 ms
9,972 KB
testcase_15 AC 32 ms
10,112 KB
testcase_16 WA -
testcase_17 AC 95 ms
13,120 KB
testcase_18 AC 93 ms
13,048 KB
testcase_19 AC 94 ms
13,128 KB
testcase_20 AC 119 ms
14,160 KB
testcase_21 AC 114 ms
14,164 KB
testcase_22 AC 114 ms
14,224 KB
testcase_23 AC 117 ms
14,216 KB
testcase_24 AC 115 ms
14,156 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 113 ms
14,236 KB
testcase_31 AC 114 ms
14,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N,X = inpl()

if N%4 == 1:
    ans = [X]
    N -= 1
elif N%4 == 0:
    ans = [X,1,2,3]
    N -= 4
elif N%4 == 2:
    if X%4 == 0 or X%4 == 2:
        ans = [X+1,1]
    else:
        ans = [X-1,1]
    N -= 2
elif N%4 == 3:
    if X%4 == 0 or X%4 == 2:
        ans = [X+1,2,3]
    else:
        ans = [X-1,2,3]
    N -= 3

c = 4
while N > 0:
    if X//4 == c//4:
        c += 4
    ans.append(c)
    ans.append(c+1)
    ans.append(c+2)
    ans.append(c+3)
    c += 4
    N -= 4

for a in ans:
    print(a)


'''
tmp = 0
for a in ans:
    tmp ^= a
print(tmp)
'''
0