結果
| 問題 | 
                            No.862 XORでX
                             | 
                    
| コンテスト | |
| ユーザー | 
                             simamumu
                         | 
                    
| 提出日時 | 2019-08-09 22:35:48 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,245 bytes | 
| コンパイル時間 | 99 ms | 
| コンパイル使用メモリ | 12,928 KB | 
| 実行使用メモリ | 15,744 KB | 
| 最終ジャッジ日時 | 2024-07-19 14:41:14 | 
| 合計ジャッジ時間 | 5,180 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 24 WA * 4 | 
ソースコード
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:
    if X == 1:
        ans = [10**5+4,10**5+5,1,1]
    elif X == 2:
        ans = [10**5+4,10**5+5,1,2]
    elif X == 3:
        ans = [10**5+4,10**5+5,1,3]
    else:
        ans = [X,1,2,3]
    N -= 4
elif N%4 == 2:
    if X == 1:
        ans = [2,3]
    elif X%4 == 0 or X%4 == 2:
        ans = [X+1,1]
    else:
        ans = [X-1,1]
    N -= 2
elif N%4 == 3:
    if X == 1:
        ans = [2,10**5+4,10**5+5]
    elif X == 2:
        ans = [3,10**5+4,10**5+5]
    elif X == 3:
        ans = [2,10**5+4,10**5+5]
    elif 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
'''
print(ans)
tmp = 0
for a in ans:
    tmp ^= a
print(tmp)
'''
for a in ans:
    print(a)
#'''
            
            
            
        
            
simamumu