結果
問題 |
No.1674 Introduction to XOR
|
ユーザー |
![]() |
提出日時 | 2021-12-22 15:55:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 1,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 88 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-16 10:44:33 |
合計ジャッジ時間 | 1,811 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
n=int(input()) ns=list(map(int,input().split())) t=0 for i in ns: t|=i #print(bin(t)) tt=list(str(bin(t)))[2:] ans=[] f=0 #print(tt) for i in tt[::-1]: if i =='1': ans.append(0) else: if f==0: f=1 ans.append(1) else: ans.append(0) #print(ans) if sum(ans) == 0: ans.append(1) #print(ans) print(int(''.join(map(str,ans))[::-1],2))