結果

問題 No.184 たのしい排他的論理和(HARD)
コンテスト
ユーザー yaoshimax
提出日時 2015-05-10 11:36:55
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 212 ms / 5,000 ms
コード長 516 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,032 ms
コンパイル使用メモリ 80,384 KB
実行使用メモリ 111,156 KB
最終ジャッジ日時 2026-03-25 19:16:46
合計ジャッジ時間 6,881 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N=int(raw_input())
A=map(int,raw_input().split())
leftmost=60
ind=0
while leftmost>=0 and ind <N:
    A.sort()
    A.reverse()
    #for a in A:
    #    print format(a,'b')
    #print 
    while leftmost>=0 and (A[ind]&(1<<leftmost))==0:
        leftmost-=1
    if leftmost<0:
        break
    #print ind,":",leftmost,"...",(1<<leftmost),"&",A[ind]
    for i in range(N):
        if i==ind:
            continue
        if (A[i] &(1<<leftmost)) !=0:
            A[i]^=A[ind]
    ind+=1
    leftmost-=1
print 1<<ind
0