結果

問題 No.2270 T0空間
ユーザー MasKoaTSMasKoaTS
提出日時 2023-02-23 12:46:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 88,192 KB
最終ジャッジ日時 2023-09-30 15:19:44
合計ジャッジ時間 6,783 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 73 ms
71,100 KB
testcase_02 AC 73 ms
71,268 KB
testcase_03 AC 73 ms
71,352 KB
testcase_04 AC 73 ms
71,312 KB
testcase_05 AC 73 ms
71,520 KB
testcase_06 AC 72 ms
71,500 KB
testcase_07 AC 71 ms
71,228 KB
testcase_08 AC 71 ms
71,168 KB
testcase_09 WA -
testcase_10 AC 73 ms
71,588 KB
testcase_11 AC 292 ms
83,144 KB
testcase_12 AC 147 ms
79,620 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
権限があれば一括ダウンロードができます

ソースコード

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 = input().rstrip()
		for j in range((n >> 6) + 1):
			lis[i][j] = int(s[j << 6: (j + 1) << 6], 2)

	MAX_INT = (1 << 64) - 1
	power = 1
	for i in range(n):
		a = [MAX_INT] * 4
		b = [0] * 4
		p = 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):
			if(a[j] & ~(b[j] | power) & MAX_INT):
				print("No")
				exit(0)
		power <<= 1
	print("Yes")

solve()
0