結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー first_vilfirst_vil
提出日時 2020-06-26 14:13:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 94,488 KB
最終ジャッジ日時 2023-09-17 18:22:56
合計ジャッジ時間 7,551 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,508 KB
testcase_01 AC 72 ms
71,332 KB
testcase_02 AC 77 ms
76,336 KB
testcase_03 AC 74 ms
71,120 KB
testcase_04 AC 74 ms
71,316 KB
testcase_05 AC 74 ms
71,412 KB
testcase_06 AC 73 ms
71,324 KB
testcase_07 AC 76 ms
75,808 KB
testcase_08 AC 154 ms
88,696 KB
testcase_09 AC 98 ms
77,316 KB
testcase_10 AC 141 ms
85,348 KB
testcase_11 AC 122 ms
82,080 KB
testcase_12 AC 167 ms
92,084 KB
testcase_13 AC 180 ms
92,368 KB
testcase_14 AC 131 ms
85,148 KB
testcase_15 AC 187 ms
93,844 KB
testcase_16 AC 162 ms
90,644 KB
testcase_17 AC 173 ms
92,264 KB
testcase_18 AC 77 ms
75,892 KB
testcase_19 AC 71 ms
71,388 KB
testcase_20 AC 117 ms
89,312 KB
testcase_21 AC 185 ms
94,136 KB
testcase_22 AC 180 ms
94,324 KB
testcase_23 AC 75 ms
76,160 KB
testcase_24 AC 71 ms
71,328 KB
testcase_25 AC 75 ms
75,980 KB
testcase_26 AC 72 ms
71,412 KB
testcase_27 AC 73 ms
71,400 KB
testcase_28 AC 144 ms
86,608 KB
testcase_29 AC 173 ms
92,156 KB
testcase_30 AC 160 ms
89,928 KB
testcase_31 AC 148 ms
88,096 KB
testcase_32 AC 162 ms
90,296 KB
testcase_33 AC 187 ms
93,912 KB
testcase_34 AC 180 ms
93,892 KB
testcase_35 AC 193 ms
94,488 KB
testcase_36 AC 180 ms
94,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
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