結果
| 問題 | No.2672 Subset Xor Sum |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-03-19 14:38:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 2,000 ms |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 85,116 KB |
| 実行使用メモリ | 140,528 KB |
| 最終ジャッジ日時 | 2026-04-16 10:42:54 |
| 合計ジャッジ時間 | 4,338 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 66 |
ソースコード
def bit_count(n):
re=0
while n>0:
if n&1:
re+=1
n>>=1
return re
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(N):
ans^=A[i]
if ans==0:
left=0
for i in range(N):
left|=A[i]
if N>bit_count(left)+1:
print('Yes')
else:
print('No')
else:
print('No')
nikoro256