結果
問題 | No.184 たのしい排他的論理和(HARD) |
ユーザー |
![]() |
提出日時 | 2015-05-10 11:36:55 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 315 ms / 5,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 1,413 ms |
コンパイル使用メモリ | 76,176 KB |
実行使用メモリ | 117,956 KB |
最終ジャッジ日時 | 2024-07-04 11:40:33 |
合計ジャッジ時間 | 9,324 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
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