結果

問題 No.2456 Stamp Art
ユーザー hiryuNhiryuN
提出日時 2023-09-01 22:46:53
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 548 bytes
コンパイル時間 1,064 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 82,296 KB
最終ジャッジ日時 2023-09-02 11:19:05
合計ジャッジ時間 7,984 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,892 KB
testcase_01 AC 71 ms
70,976 KB
testcase_02 AC 71 ms
71,420 KB
testcase_03 AC 216 ms
78,608 KB
testcase_04 AC 72 ms
70,940 KB
testcase_05 AC 81 ms
76,332 KB
testcase_06 AC 239 ms
81,152 KB
testcase_07 AC 286 ms
81,172 KB
testcase_08 AC 264 ms
81,488 KB
testcase_09 AC 263 ms
81,412 KB
testcase_10 AC 604 ms
82,296 KB
testcase_11 AC 230 ms
81,012 KB
testcase_12 AC 249 ms
81,256 KB
testcase_13 AC 246 ms
81,596 KB
testcase_14 AC 251 ms
81,200 KB
testcase_15 AC 239 ms
81,276 KB
testcase_16 AC 174 ms
79,232 KB
testcase_17 AC 80 ms
76,376 KB
testcase_18 AC 78 ms
76,312 KB
testcase_19 AC 204 ms
79,900 KB
testcase_20 AC 258 ms
81,348 KB
testcase_21 AC 252 ms
81,064 KB
testcase_22 AC 446 ms
81,476 KB
testcase_23 AC 97 ms
76,892 KB
testcase_24 AC 172 ms
77,376 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int,input().split())
X=[]
ans=100000
for i in range(h):
    s=input()
    X.append(s)
    cnt=0
    for j in s:
        if j=="." and cnt!=0:
            ans=min(ans,cnt)
            cnt=0
        if j=="#":
            cnt+=1
    if cnt!=0:
        ans=min(ans,cnt)
for i in range(w):
    cnt=0
    for j in range(h):
        key=X[j][i]
        if key=="." and cnt!=0:
            ans=min(ans,cnt)
            cnt=0
        if key=="#":
            cnt+=1
    if cnt!=0:
        ans=min(ans,cnt)
print(ans)          
        
            
0