結果

問題 No.2270 T0空間
ユーザー MasKoaTSMasKoaTS
提出日時 2023-02-23 13:31:17
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 775 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 86,220 KB
実行使用メモリ 103,836 KB
最終ジャッジ日時 2023-09-30 16:07:45
合計ジャッジ時間 9,506 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,476 KB
testcase_01 AC 73 ms
71,420 KB
testcase_02 AC 73 ms
71,232 KB
testcase_03 AC 73 ms
71,320 KB
testcase_04 AC 74 ms
71,228 KB
testcase_05 AC 78 ms
71,056 KB
testcase_06 AC 73 ms
71,104 KB
testcase_07 AC 73 ms
71,288 KB
testcase_08 AC 73 ms
71,104 KB
testcase_09 AC 75 ms
71,272 KB
testcase_10 AC 75 ms
71,056 KB
testcase_11 AC 304 ms
84,428 KB
testcase_12 AC 166 ms
80,124 KB
testcase_13 AC 371 ms
90,316 KB
testcase_14 AC 965 ms
90,552 KB
testcase_15 AC 331 ms
90,528 KB
testcase_16 AC 442 ms
93,916 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	m = int(input())
	lis = [[] for _ in [0] * m]
	ZEROS = ''.join(['0'] * (256 - n))
	ONES = ''.join(['1'] * n)
	s = ''.join([ZEROS, ONES])
	LIS = [int(s[j << 6: (j + 1) << 6], 2) for j in range(4)]
	for i in range(m):
		s = ''.join([ZEROS, input().rstrip()])
		lis[i] = [int(s[j << 6: (j + 1) << 6], 2) for j in range(4)]
	
	for i in range(n):
		a = LIS[:]
		b = [0] * 4
		p = 3 - (i >> 6)
		q = i & 63
		for j in range(m):
			if((lis[j][p] >> q) & 1):
				for k in range(4):
					a[k] &= lis[j][k]
			else:
				for k in range(4):
					b[k] |= lis[j][k]
		for j in range(4):
			# print(bin(a[j]), bin(~(b[j] | (1 << q)))
			if(a[j] & ~(b[j] | (1 << q))):
				print("No")
				exit(0)
	print("Yes")

solve()
0