結果

問題 No.2270 T0空間
ユーザー MasKoaTSMasKoaTS
提出日時 2023-02-22 22:31:10
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 424 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 96,688 KB
最終ジャッジ日時 2023-09-30 06:08:00
合計ジャッジ時間 16,880 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,148 KB
testcase_01 AC 71 ms
71,012 KB
testcase_02 AC 73 ms
71,156 KB
testcase_03 AC 72 ms
71,136 KB
testcase_04 AC 72 ms
71,196 KB
testcase_05 AC 70 ms
70,976 KB
testcase_06 AC 71 ms
71,308 KB
testcase_07 AC 70 ms
71,248 KB
testcase_08 AC 71 ms
71,128 KB
testcase_09 AC 72 ms
71,188 KB
testcase_10 AC 73 ms
71,020 KB
testcase_11 AC 153 ms
81,656 KB
testcase_12 AC 111 ms
78,576 KB
testcase_13 AC 253 ms
88,368 KB
testcase_14 AC 500 ms
88,412 KB
testcase_15 AC 439 ms
88,284 KB
testcase_16 AC 706 ms
94,104 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 1,929 ms
93,344 KB
testcase_20 TLE -
testcase_21 AC 1,914 ms
93,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	m = int(input())
	st = set([])
	for _ in [0] * m:
		k = 0
		for i, c in enumerate(input().rstrip()):
			k |= int(c) << i
		st.add(k)

	MAX_INT = (1 << n) - 1
	for i in range(n):
		a = MAX_INT
		b = 0
		for k in st:
			if((k >> i) & 1):
				a &= k
			else:
				b |= k
		if(a & ~b & (MAX_INT - (1 << i))):
			print("No")
			exit(0)
	print("Yes")

solve()
0