結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー fmhrfmhr
提出日時 2015-04-17 14:48:05
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 8,800 KB
最終ジャッジ日時 2023-09-11 11:03:53
合計ジャッジ時間 1,482 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,880 KB
testcase_01 AC 16 ms
7,980 KB
testcase_02 AC 15 ms
7,868 KB
testcase_03 AC 15 ms
7,880 KB
testcase_04 AC 15 ms
7,876 KB
testcase_05 AC 15 ms
7,868 KB
testcase_06 AC 15 ms
7,868 KB
testcase_07 AC 33 ms
8,796 KB
testcase_08 AC 33 ms
8,672 KB
testcase_09 AC 27 ms
8,552 KB
testcase_10 AC 30 ms
8,624 KB
testcase_11 AC 33 ms
8,780 KB
testcase_12 AC 15 ms
7,840 KB
testcase_13 AC 15 ms
7,924 KB
testcase_14 AC 18 ms
8,312 KB
testcase_15 AC 35 ms
8,800 KB
testcase_16 AC 16 ms
7,924 KB
testcase_17 AC 20 ms
8,408 KB
testcase_18 AC 33 ms
8,588 KB
testcase_19 AC 18 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

ret = 0
for i in range(n):
    if a[i]:
        ret += 1
        x = 0
        while (2**(x+1)) <= a[i]:
            x += 1
        for y in range(i+1, n, 1):
            if a[y] & (2 ** x):
                a[y] ^= a[i]

print(2**ret)
0