結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー rpy3cpprpy3cpp
提出日時 2015-04-17 15:43:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 195 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 103,612 KB
最終ジャッジ日時 2023-09-17 16:40:51
合計ジャッジ時間 6,902 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,392 KB
testcase_01 AC 78 ms
71,284 KB
testcase_02 AC 77 ms
75,160 KB
testcase_03 AC 74 ms
71,348 KB
testcase_04 AC 75 ms
71,208 KB
testcase_05 AC 78 ms
71,168 KB
testcase_06 AC 77 ms
71,248 KB
testcase_07 AC 76 ms
71,324 KB
testcase_08 AC 152 ms
95,240 KB
testcase_09 AC 97 ms
77,988 KB
testcase_10 AC 138 ms
90,780 KB
testcase_11 AC 123 ms
85,204 KB
testcase_12 AC 171 ms
99,620 KB
testcase_13 AC 183 ms
100,392 KB
testcase_14 AC 133 ms
90,276 KB
testcase_15 AC 183 ms
103,400 KB
testcase_16 AC 165 ms
97,836 KB
testcase_17 AC 179 ms
100,476 KB
testcase_18 AC 79 ms
75,632 KB
testcase_19 AC 76 ms
71,244 KB
testcase_20 AC 89 ms
82,200 KB
testcase_21 AC 192 ms
103,272 KB
testcase_22 AC 189 ms
103,612 KB
testcase_23 AC 79 ms
75,648 KB
testcase_24 AC 76 ms
71,332 KB
testcase_25 AC 80 ms
75,452 KB
testcase_26 AC 75 ms
71,356 KB
testcase_27 AC 77 ms
71,072 KB
testcase_28 AC 146 ms
92,624 KB
testcase_29 AC 174 ms
100,464 KB
testcase_30 AC 166 ms
97,548 KB
testcase_31 AC 149 ms
94,716 KB
testcase_32 AC 164 ms
98,936 KB
testcase_33 AC 193 ms
103,308 KB
testcase_34 AC 188 ms
103,568 KB
testcase_35 AC 195 ms
103,232 KB
testcase_36 AC 193 ms
103,460 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