結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー first_vilfirst_vil
提出日時 2020-06-26 13:57:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 200 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 95,496 KB
最終ジャッジ日時 2023-09-17 18:20:52
合計ジャッジ時間 6,669 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,348 KB
testcase_01 AC 68 ms
71,208 KB
testcase_02 AC 70 ms
71,356 KB
testcase_03 AC 70 ms
71,240 KB
testcase_04 AC 68 ms
71,172 KB
testcase_05 AC 70 ms
71,228 KB
testcase_06 AC 70 ms
71,420 KB
testcase_07 AC 76 ms
75,792 KB
testcase_08 AC 161 ms
89,592 KB
testcase_09 AC 94 ms
77,140 KB
testcase_10 AC 143 ms
85,944 KB
testcase_11 AC 122 ms
82,292 KB
testcase_12 AC 178 ms
93,076 KB
testcase_13 AC 184 ms
93,608 KB
testcase_14 AC 136 ms
85,524 KB
testcase_15 AC 191 ms
95,496 KB
testcase_16 AC 171 ms
91,772 KB
testcase_17 AC 180 ms
93,276 KB
testcase_18 AC 70 ms
75,772 KB
testcase_19 AC 70 ms
71,268 KB
testcase_20 AC 113 ms
90,192 KB
testcase_21 AC 196 ms
94,484 KB
testcase_22 AC 200 ms
94,660 KB
testcase_23 AC 72 ms
76,196 KB
testcase_24 AC 69 ms
71,248 KB
testcase_25 AC 72 ms
75,764 KB
testcase_26 AC 69 ms
71,368 KB
testcase_27 AC 68 ms
71,240 KB
testcase_28 AC 147 ms
87,372 KB
testcase_29 AC 178 ms
92,684 KB
testcase_30 AC 164 ms
90,984 KB
testcase_31 AC 154 ms
89,008 KB
testcase_32 AC 175 ms
91,428 KB
testcase_33 AC 194 ms
94,828 KB
testcase_34 AC 199 ms
95,176 KB
testcase_35 AC 196 ms
94,340 KB
testcase_36 AC 198 ms
94,412 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