結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,872 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 1,729 ms
12,288 KB
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 19 ms
7,824 KB
testcase_06 AC 1,792 ms
12,472 KB
testcase_07 AC 1,476 ms
12,452 KB
testcase_08 AC 2,885 ms
12,344 KB
testcase_09 AC 1,665 ms
12,436 KB
testcase_10 AC 1,790 ms
12,468 KB
testcase_11 AC 1,709 ms
12,360 KB
testcase_12 AC 1,693 ms
12,384 KB
testcase_13 AC 1,824 ms
12,420 KB
testcase_14 AC 1,717 ms
12,368 KB
testcase_15 AC 1,717 ms
12,380 KB
testcase_16 AC 903 ms
10,272 KB
testcase_17 AC 18 ms
7,800 KB
testcase_18 AC 17 ms
7,888 KB
testcase_19 AC 1,167 ms
10,876 KB
testcase_20 AC 1,816 ms
12,436 KB
testcase_21 AC 1,444 ms
11,980 KB
testcase_22 AC 1,709 ms
12,492 KB
testcase_23 AC 108 ms
8,236 KB
testcase_24 AC 157 ms
8,644 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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