結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー rpy3cpprpy3cpp
提出日時 2015-04-17 15:29:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 26,260 KB
最終ジャッジ日時 2023-09-17 16:40:31
合計ジャッジ時間 15,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,764 KB
testcase_01 WA -
testcase_02 AC 17 ms
7,720 KB
testcase_03 AC 16 ms
7,788 KB
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 16 ms
7,768 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 16 ms
7,964 KB
testcase_08 AC 557 ms
19,404 KB
testcase_09 AC 110 ms
10,492 KB
testcase_10 AC 410 ms
17,344 KB
testcase_11 AC 288 ms
15,344 KB
testcase_12 AC 678 ms
24,720 KB
testcase_13 AC 734 ms
25,224 KB
testcase_14 AC 388 ms
16,784 KB
testcase_15 AC 809 ms
25,864 KB
testcase_16 AC 649 ms
24,500 KB
testcase_17 AC 709 ms
25,024 KB
testcase_18 AC 16 ms
7,756 KB
testcase_19 AC 16 ms
7,824 KB
testcase_20 AC 32 ms
9,400 KB
testcase_21 AC 833 ms
26,260 KB
testcase_22 AC 825 ms
26,144 KB
testcase_23 AC 16 ms
7,760 KB
testcase_24 AC 15 ms
7,848 KB
testcase_25 AC 16 ms
7,840 KB
testcase_26 AC 16 ms
7,840 KB
testcase_27 AC 16 ms
7,796 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 790 ms
26,060 KB
testcase_34 AC 812 ms
25,884 KB
testcase_35 AC 818 ms
26,104 KB
testcase_36 AC 772 ms
26,060 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
    rank_upper_bound = min(digits, len(A))
    for rank in range(rank_upper_bound):
        Ar = max(A)
        if Ar == 0:
            break
        msb = len(bin(Ar)) - 2
        index = 1 << msb
        for i in range(len(A)):
            if A[i] & index:
                A[i] ^= Ar
    if max(A):
        rank += 1
    return 1 << rank

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