結果

問題 No.2456 Stamp Art
ユーザー hiro1729hiro1729
提出日時 2023-09-02 06:46:00
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 383 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 81,868 KB
最終ジャッジ日時 2023-09-02 11:22:18
合計ジャッジ時間 8,121 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,348 KB
testcase_01 AC 69 ms
71,428 KB
testcase_02 AC 69 ms
71,304 KB
testcase_03 AC 171 ms
79,380 KB
testcase_04 AC 66 ms
71,536 KB
testcase_05 AC 75 ms
76,652 KB
testcase_06 AC 259 ms
81,520 KB
testcase_07 AC 297 ms
81,692 KB
testcase_08 AC 289 ms
81,756 KB
testcase_09 AC 284 ms
81,700 KB
testcase_10 AC 606 ms
81,860 KB
testcase_11 AC 241 ms
81,816 KB
testcase_12 AC 269 ms
81,868 KB
testcase_13 AC 262 ms
81,604 KB
testcase_14 AC 269 ms
81,680 KB
testcase_15 AC 265 ms
81,528 KB
testcase_16 AC 169 ms
79,376 KB
testcase_17 AC 75 ms
76,528 KB
testcase_18 AC 77 ms
76,148 KB
testcase_19 AC 201 ms
80,256 KB
testcase_20 AC 264 ms
81,324 KB
testcase_21 AC 254 ms
81,168 KB
testcase_22 AC 449 ms
81,748 KB
testcase_23 AC 100 ms
77,596 KB
testcase_24 AC 164 ms
77,200 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
s = [input() for _ in range(h)]
a = 1e5
for i in s:
	c = 0
	for j in i:
		if j == '.' and c != 0:
			a = min(a, c)
			c = 0
		if j == '#':
			c += 1
	if c != 0:
		a = min(a, c)
for i in range(w):
	c = 0
	for j in range(h):
		k = s[j][i]
		if k == '.' and c != 0:
			a = min(a, c)
			c = 0
		if k == '#':
			c += 1
	if c != 0:
		a = min(a, c)
print(a)
0