結果

問題 No.2061 XOR Sort
ユーザー minimumminimum
提出日時 2022-08-26 23:11:50
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 537 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 99,964 KB
最終ジャッジ日時 2024-04-22 01:16:16
合計ジャッジ時間 8,223 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
57,216 KB
testcase_01 AC 37 ms
51,712 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 271 ms
78,592 KB
testcase_04 AC 38 ms
52,224 KB
testcase_05 AC 1,046 ms
83,712 KB
testcase_06 AC 895 ms
84,316 KB
testcase_07 AC 165 ms
77,440 KB
testcase_08 AC 101 ms
76,288 KB
testcase_09 AC 231 ms
78,080 KB
testcase_10 AC 89 ms
75,904 KB
testcase_11 AC 133 ms
76,800 KB
testcase_12 AC 1,002 ms
83,456 KB
testcase_13 AC 36 ms
51,968 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import setrecursionlimit
setrecursionlimit(10 ** 5)
MOD = 998244353

flag = [0] * 32

def slv(a, k):
    if len(a) <= 1 or k < 0:
        pass
    else:
        if ((a[0] >> k) & 1) or ((a[-1] >> k) & 1 == 0):
            slv(a, k - 1)
        else:
            flag[k] = 1
            for i in range(1, len(a)):
                if (a[i] >> k) & 1:
                    slv(a[:i], k - 1)
                    slv(a[i:], k - 1)

N = int(input())
a = list(map(int, input().split()))
a.sort()
slv(a, 32)
print(pow(2, sum(flag), MOD))
0