結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー rpy3cpprpy3cpp
提出日時 2015-04-17 15:39:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,082 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 26,100 KB
最終ジャッジ日時 2023-09-17 16:41:04
合計ジャッジ時間 19,033 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,788 KB
testcase_01 AC 15 ms
7,888 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 15 ms
7,940 KB
testcase_04 AC 16 ms
7,940 KB
testcase_05 AC 15 ms
7,788 KB
testcase_06 AC 17 ms
7,800 KB
testcase_07 AC 16 ms
7,828 KB
testcase_08 AC 699 ms
19,212 KB
testcase_09 AC 133 ms
10,388 KB
testcase_10 AC 524 ms
17,356 KB
testcase_11 AC 360 ms
15,488 KB
testcase_12 AC 830 ms
24,580 KB
testcase_13 AC 919 ms
25,212 KB
testcase_14 AC 477 ms
16,772 KB
testcase_15 AC 1,014 ms
25,732 KB
testcase_16 AC 827 ms
24,340 KB
testcase_17 AC 877 ms
24,844 KB
testcase_18 AC 16 ms
7,796 KB
testcase_19 AC 16 ms
7,828 KB
testcase_20 AC 33 ms
9,364 KB
testcase_21 AC 1,082 ms
26,044 KB
testcase_22 AC 1,080 ms
26,100 KB
testcase_23 AC 17 ms
7,716 KB
testcase_24 AC 16 ms
7,940 KB
testcase_25 AC 16 ms
7,788 KB
testcase_26 AC 15 ms
7,880 KB
testcase_27 AC 16 ms
7,852 KB
testcase_28 AC 561 ms
17,860 KB
testcase_29 AC 838 ms
24,940 KB
testcase_30 AC 710 ms
19,720 KB
testcase_31 AC 600 ms
18,524 KB
testcase_32 AC 786 ms
24,532 KB
testcase_33 AC 1,031 ms
25,784 KB
testcase_34 AC 1,041 ms
25,636 KB
testcase_35 AC 1,046 ms
25,988 KB
testcase_36 AC 1,007 ms
25,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def read_data():
    N = int(input())
    A = list(set(map(int, input().split())))
    return A

def solve(A):
    digits = len(bin(max(A))) - 2
    index = 1 << digits
    N = len(A)
    rank_upper_bound = min(digits, N)
    for rank in range(1, rank_upper_bound + 1):
        Ar = max(A)
        if Ar == 0:
            rank -= 1
            break
        index = 1 << (len(bin(Ar)) - 3)
        for i in range(N):
            if A[i] & index:
                A[i] ^= Ar
    return 1 << rank

A = read_data()
print(solve(A))
0