結果

問題 No.2270 T0空間
ユーザー MasKoaTSMasKoaTS
提出日時 2023-02-23 13:21:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 792 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 109,000 KB
最終ジャッジ日時 2023-09-30 15:45:34
合計ジャッジ時間 10,982 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,448 KB
testcase_01 AC 74 ms
71,420 KB
testcase_02 AC 73 ms
71,612 KB
testcase_03 AC 73 ms
71,560 KB
testcase_04 AC 74 ms
71,360 KB
testcase_05 AC 73 ms
71,564 KB
testcase_06 AC 73 ms
71,284 KB
testcase_07 AC 74 ms
71,236 KB
testcase_08 AC 74 ms
71,136 KB
testcase_09 AC 74 ms
71,256 KB
testcase_10 AC 72 ms
71,584 KB
testcase_11 AC 504 ms
88,152 KB
testcase_12 AC 240 ms
81,596 KB
testcase_13 AC 592 ms
95,536 KB
testcase_14 AC 1,174 ms
95,564 KB
testcase_15 AC 549 ms
95,412 KB
testcase_16 AC 573 ms
98,900 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 = [[0] * 4 for _ in [0] * m]
	for i in range(m):
		s = ''.join(['0'] * (256 - n) + [input().rstrip()])
		lis[i] = [int(s[j << 6: (j + 1) << 6], 2) for j in range(4)]

	MAX_INT = (1 << 64) - 1
	s = ''.join(['0'] * (256 - n) + ['1'] * n)
	LIS = [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)) & MAX_INT))
			if(a[j] & ~(b[j] | (1 << q)) & MAX_INT):
				print("No")
				exit(0)
	print("Yes")

solve()
0