結果

問題 No.2911 位相の公理
ユーザー titia
提出日時 2024-10-04 22:21:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 412 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 70,700 KB
最終ジャッジ日時 2024-10-04 22:21:44
合計ジャッジ時間 4,668 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
S=[int(input().strip(),2) for i in range(M)]

if 0 in S and ((1<<N)-1) in S:
    pass
else:
    print("No")
    exit()

for i in range(M):
    for j in range(i+1,M):
        X=S[i]
        Y=S[j]

        Z=X&Y
        W=X|Y

        if Z in S and W in S:
            pass
        else:
            print("No")
            exit()

print("Yes")
0