結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー first_vilfirst_vil
提出日時 2020-06-26 13:56:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,335 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 547 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 21,260 KB
最終ジャッジ日時 2023-09-17 18:24:15
合計ジャッジ時間 39,492 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 16 ms
7,844 KB
testcase_03 AC 16 ms
7,872 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 15 ms
7,948 KB
testcase_06 AC 15 ms
7,852 KB
testcase_07 AC 16 ms
7,780 KB
testcase_08 AC 1,523 ms
17,240 KB
testcase_09 AC 288 ms
9,892 KB
testcase_10 AC 1,113 ms
14,912 KB
testcase_11 AC 773 ms
13,476 KB
testcase_12 AC 1,822 ms
18,520 KB
testcase_13 AC 2,008 ms
19,380 KB
testcase_14 AC 1,052 ms
14,532 KB
testcase_15 AC 2,107 ms
21,260 KB
testcase_16 AC 1,784 ms
19,152 KB
testcase_17 AC 1,888 ms
19,160 KB
testcase_18 AC 16 ms
7,872 KB
testcase_19 AC 16 ms
7,780 KB
testcase_20 AC 1,086 ms
10,000 KB
testcase_21 AC 2,258 ms
20,688 KB
testcase_22 AC 2,335 ms
20,664 KB
testcase_23 AC 16 ms
7,852 KB
testcase_24 AC 15 ms
7,912 KB
testcase_25 AC 16 ms
7,828 KB
testcase_26 AC 15 ms
7,816 KB
testcase_27 AC 15 ms
7,832 KB
testcase_28 AC 1,237 ms
16,340 KB
testcase_29 AC 1,779 ms
19,044 KB
testcase_30 AC 1,637 ms
18,620 KB
testcase_31 AC 1,351 ms
16,436 KB
testcase_32 AC 1,790 ms
19,324 KB
testcase_33 AC 2,189 ms
20,432 KB
testcase_34 AC 2,160 ms
20,424 KB
testcase_35 AC 2,229 ms
20,644 KB
testcase_36 AC 2,235 ms
20,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
rank=0
for j in range(60,-1,-1):
    idx=-1
    for i in range(rank,n):
        if a[i]&(1<<j):
            idx=i
            break
    if idx==-1:
        continue
    (a[rank],a[idx])=(a[idx],a[rank])
    for i in range(n):
        if a[i]&(1<<j) and not i==rank:
            a[i]^=a[rank]
    rank+=1
print(1<<rank)
0