結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー first_vilfirst_vil
提出日時 2020-06-26 13:59:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 95,232 KB
最終ジャッジ日時 2023-09-17 18:22:01
合計ジャッジ時間 7,443 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,148 KB
testcase_01 AC 77 ms
71,248 KB
testcase_02 AC 75 ms
70,980 KB
testcase_03 AC 75 ms
70,976 KB
testcase_04 AC 76 ms
71,072 KB
testcase_05 AC 74 ms
71,116 KB
testcase_06 AC 75 ms
71,280 KB
testcase_07 AC 81 ms
75,540 KB
testcase_08 AC 174 ms
89,300 KB
testcase_09 AC 103 ms
77,176 KB
testcase_10 AC 151 ms
85,596 KB
testcase_11 AC 130 ms
82,192 KB
testcase_12 AC 184 ms
93,064 KB
testcase_13 AC 190 ms
93,244 KB
testcase_14 AC 142 ms
85,508 KB
testcase_15 AC 200 ms
95,232 KB
testcase_16 AC 182 ms
91,292 KB
testcase_17 AC 188 ms
93,288 KB
testcase_18 AC 77 ms
75,640 KB
testcase_19 AC 73 ms
71,276 KB
testcase_20 AC 123 ms
89,756 KB
testcase_21 AC 209 ms
94,092 KB
testcase_22 AC 202 ms
94,364 KB
testcase_23 AC 83 ms
75,832 KB
testcase_24 AC 77 ms
71,200 KB
testcase_25 AC 78 ms
75,792 KB
testcase_26 AC 74 ms
71,268 KB
testcase_27 AC 76 ms
71,272 KB
testcase_28 AC 157 ms
87,072 KB
testcase_29 AC 190 ms
92,548 KB
testcase_30 AC 171 ms
90,624 KB
testcase_31 AC 159 ms
88,836 KB
testcase_32 AC 179 ms
91,500 KB
testcase_33 AC 199 ms
94,924 KB
testcase_34 AC 198 ms
94,740 KB
testcase_35 AC 200 ms
94,064 KB
testcase_36 AC 200 ms
94,372 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 i!=rank:
            a[i]^=a[rank]
    rank+=1
print(1<<rank)
0