結果

問題 No.2061 XOR Sort
ユーザー 👑 tamatotamato
提出日時 2022-08-26 22:30:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 827 ms / 2,000 ms
コード長 702 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 293,208 KB
最終ジャッジ日時 2024-04-22 00:35:35
合計ジャッジ時間 11,466 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
52,096 KB
testcase_01 AC 46 ms
51,584 KB
testcase_02 AC 41 ms
51,712 KB
testcase_03 AC 51 ms
58,624 KB
testcase_04 AC 43 ms
51,456 KB
testcase_05 AC 47 ms
58,112 KB
testcase_06 AC 50 ms
57,856 KB
testcase_07 AC 52 ms
57,856 KB
testcase_08 AC 44 ms
51,712 KB
testcase_09 AC 49 ms
57,984 KB
testcase_10 AC 43 ms
51,840 KB
testcase_11 AC 47 ms
57,472 KB
testcase_12 AC 48 ms
57,856 KB
testcase_13 AC 42 ms
52,480 KB
testcase_14 AC 449 ms
221,540 KB
testcase_15 AC 445 ms
222,152 KB
testcase_16 AC 811 ms
293,208 KB
testcase_17 AC 550 ms
263,108 KB
testcase_18 AC 587 ms
274,512 KB
testcase_19 AC 552 ms
261,976 KB
testcase_20 AC 113 ms
83,840 KB
testcase_21 AC 255 ms
144,080 KB
testcase_22 AC 445 ms
222,180 KB
testcase_23 AC 70 ms
71,936 KB
testcase_24 AC 824 ms
287,340 KB
testcase_25 AC 827 ms
287,860 KB
testcase_26 AC 826 ms
286,700 KB
testcase_27 AC 822 ms
287,596 KB
testcase_28 AC 820 ms
287,088 KB
testcase_29 AC 142 ms
118,912 KB
testcase_30 AC 43 ms
52,096 KB
testcase_31 AC 81 ms
75,264 KB
testcase_32 AC 43 ms
51,584 KB
testcase_33 AC 42 ms
51,840 KB
testcase_34 AC 42 ms
51,968 KB
testcase_35 AC 43 ms
51,584 KB
testcase_36 AC 45 ms
51,584 KB
testcase_37 AC 43 ms
51,968 KB
testcase_38 AC 43 ms
51,968 KB
testcase_39 AC 42 ms
52,096 KB
testcase_40 AC 41 ms
52,352 KB
testcase_41 AC 47 ms
52,224 KB
testcase_42 AC 44 ms
51,968 KB
testcase_43 AC 43 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = [list(map(int, input().split()))]

    ans = 1
    for i in range(30, -1, -1):
        flg = 0
        A_new = []
        for AA in A:
            a0 = []
            a1 = []
            for a in AA:
                if a >> i & 1:
                    a1.append(a)
                else:
                    a0.append(a)
            if a0 and a1:
                flg = 1
            if a0:
                A_new.append(a0)
            if a1:
                A_new.append(a1)
        if flg:
            ans = (ans * 2) % mod
        A = A_new
    print(ans)


if __name__ == '__main__':
    main()
0