結果

問題 No.2456 Stamp Art
ユーザー hiro1729hiro1729
提出日時 2023-09-02 06:45:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 383 bytes
コンパイル時間 1,230 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 12,488 KB
最終ジャッジ日時 2023-09-02 11:22:41
合計ジャッジ時間 30,480 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,804 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,748 KB
testcase_03 AC 1,720 ms
12,468 KB
testcase_04 AC 15 ms
7,800 KB
testcase_05 AC 19 ms
7,776 KB
testcase_06 AC 1,789 ms
12,412 KB
testcase_07 AC 1,439 ms
12,272 KB
testcase_08 AC 3,111 ms
12,320 KB
testcase_09 AC 1,630 ms
12,396 KB
testcase_10 AC 1,718 ms
12,340 KB
testcase_11 AC 1,702 ms
12,488 KB
testcase_12 AC 1,679 ms
12,476 KB
testcase_13 AC 1,783 ms
12,436 KB
testcase_14 AC 1,702 ms
12,312 KB
testcase_15 AC 1,710 ms
12,308 KB
testcase_16 AC 862 ms
10,240 KB
testcase_17 AC 19 ms
7,940 KB
testcase_18 AC 17 ms
7,764 KB
testcase_19 AC 1,209 ms
10,880 KB
testcase_20 AC 1,789 ms
12,460 KB
testcase_21 AC 1,430 ms
11,688 KB
testcase_22 AC 1,654 ms
12,424 KB
testcase_23 AC 104 ms
8,208 KB
testcase_24 AC 156 ms
8,512 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