結果

問題 No.3311 フィルター
コンテスト
ユーザー timi
提出日時 2025-10-30 21:02:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 82,188 KB
実行使用メモリ 84,564 KB
最終ジャッジ日時 2025-10-30 21:02:17
合計ジャッジ時間 3,468 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
c=-1;ans='Yes'
S=set()
for i in range(M):
  s=int(input(),2)
  S.add(s)
  if s==0:
    ans='No'
  if c==-1:
    c=s 
  else:
    c&=s 

if c not in S:
  ans='No'

s=N-bin(c)[2:].count('1')
if M!=pow(2,s):
  ans='No'
print(ans)

  
0