結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー ああいいああいい
提出日時 2021-12-24 16:35:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,617 ms / 5,000 ms
コード長 315 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 11,804 KB
実行使用メモリ 23,420 KB
最終ジャッジ日時 2023-10-19 18:58:08
合計ジャッジ時間 31,053 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,012 KB
testcase_01 AC 29 ms
10,012 KB
testcase_02 AC 29 ms
10,012 KB
testcase_03 AC 29 ms
10,012 KB
testcase_04 AC 29 ms
10,012 KB
testcase_05 AC 29 ms
10,012 KB
testcase_06 AC 29 ms
10,012 KB
testcase_07 AC 29 ms
10,012 KB
testcase_08 AC 1,198 ms
19,760 KB
testcase_09 AC 255 ms
11,784 KB
testcase_10 AC 847 ms
16,760 KB
testcase_11 AC 615 ms
15,196 KB
testcase_12 AC 1,322 ms
21,296 KB
testcase_13 AC 1,405 ms
21,116 KB
testcase_14 AC 846 ms
16,228 KB
testcase_15 AC 1,617 ms
23,148 KB
testcase_16 AC 1,309 ms
20,996 KB
testcase_17 AC 1,383 ms
20,916 KB
testcase_18 AC 28 ms
10,012 KB
testcase_19 AC 28 ms
10,012 KB
testcase_20 AC 935 ms
11,804 KB
testcase_21 AC 1,606 ms
22,560 KB
testcase_22 AC 1,587 ms
22,560 KB
testcase_23 AC 29 ms
10,012 KB
testcase_24 AC 28 ms
10,012 KB
testcase_25 AC 29 ms
10,012 KB
testcase_26 AC 29 ms
10,012 KB
testcase_27 AC 29 ms
10,012 KB
testcase_28 AC 988 ms
18,240 KB
testcase_29 AC 1,378 ms
20,772 KB
testcase_30 AC 1,156 ms
20,372 KB
testcase_31 AC 1,066 ms
18,240 KB
testcase_32 AC 1,289 ms
21,012 KB
testcase_33 AC 1,591 ms
23,420 KB
testcase_34 AC 1,527 ms
22,224 KB
testcase_35 AC 1,612 ms
22,492 KB
testcase_36 AC 1,551 ms
22,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
for j in range(61):
    mask = 1 << j
    m = -1
    for i in range(N):
        if A[i] & mask:
            if m == -1:
                m = A[i]
                A[i] = 0
                ans += 1
            else:
                A[i] ^= m
print(2 ** ans)
0