結果

問題 No.2061 XOR Sort
ユーザー chineristAC
提出日時 2022-08-26 23:27:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 890 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 123,348 KB
最終ジャッジ日時 2024-10-14 00:10:22
合計ジャッジ時間 11,400 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from itertools import cycle, permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N = int(input())
A = li()

res = 1
check = [0] * 30

def calc(_A,n):
    if n==-1:
        return 
    X = [a for a in _A if a>>n & 1]
    Y = [a for a in _A if a>>n & 1 == 0]
    if X and Y:
        check[n] = 1
    if n!=0:
        if X:
            calc(X,n-1)
        if Y:
            calc(Y,n-1)

calc(A,29)

for i in range(30):
    if check[i]:
        res *= 2


print(res % 998244353)
0