結果
問題 | No.2911 位相の公理 |
ユーザー |
|
提出日時 | 2024-10-04 23:19:46 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 570 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 81,904 KB |
実行使用メモリ | 69,024 KB |
最終ジャッジ日時 | 2024-10-04 23:19:54 |
合計ジャッジ時間 | 1,977 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 RE * 16 |
ソースコード
import sysinput = sys.stdin.readlineN, M = map(int, input().split())S = [input().strip() for _ in range(M)]T = set(S)if "1"*N not in T:print("No")exit()for i in range(N):for j in range(i+1, N):si = S[i]sj = S[j]if si&sj not in T:print("No")exit()dp = [0 for _ in range(N)]for s in S:for i in range(N):if s[i]=="1":dp[i] = 1if "0"*N not in T:print("No")exit()dp.reverse()tmp = "".join(map(str, dp))if tmp not in T:print("No")exit()print("Yes")