結果
問題 | No.184 たのしい排他的論理和(HARD) |
ユーザー |
![]() |
提出日時 | 2015-05-10 11:34:39 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 505 bytes |
コンパイル時間 | 698 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 16,584 KB |
最終ジャッジ日時 | 2024-07-04 11:41:41 |
合計ジャッジ時間 | 36,614 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 RE * 7 |
ソースコード
N=int(raw_input()) A=map(int,raw_input().split()) leftmost=60 ind=0 while leftmost>=0: 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