結果

問題 No.179 塗り分け
ユーザー mlihua09mlihua09
提出日時 2020-08-23 14:06:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,467 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 83,236 KB
最終ジャッジ日時 2024-04-23 17:38:53
合計ジャッジ時間 16,821 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,608 KB
testcase_01 AC 39 ms
54,432 KB
testcase_02 AC 37 ms
54,948 KB
testcase_03 AC 41 ms
53,948 KB
testcase_04 AC 42 ms
55,224 KB
testcase_05 AC 190 ms
77,856 KB
testcase_06 AC 44 ms
55,400 KB
testcase_07 WA -
testcase_08 AC 876 ms
80,372 KB
testcase_09 AC 849 ms
80,740 KB
testcase_10 AC 50 ms
65,064 KB
testcase_11 AC 50 ms
63,908 KB
testcase_12 AC 1,114 ms
83,236 KB
testcase_13 AC 60 ms
66,732 KB
testcase_14 AC 59 ms
68,432 KB
testcase_15 AC 41 ms
53,804 KB
testcase_16 AC 41 ms
54,232 KB
testcase_17 WA -
testcase_18 AC 94 ms
77,304 KB
testcase_19 AC 92 ms
76,952 KB
testcase_20 AC 971 ms
83,224 KB
testcase_21 AC 941 ms
81,712 KB
testcase_22 AC 926 ms
81,628 KB
testcase_23 AC 51 ms
65,024 KB
testcase_24 AC 953 ms
81,492 KB
testcase_25 AC 64 ms
71,792 KB
testcase_26 AC 233 ms
77,664 KB
testcase_27 AC 1,000 ms
81,940 KB
testcase_28 AC 109 ms
76,548 KB
testcase_29 AC 1,092 ms
83,168 KB
testcase_30 AC 493 ms
80,252 KB
testcase_31 AC 1,086 ms
82,460 KB
testcase_32 AC 355 ms
78,984 KB
testcase_33 AC 1,054 ms
82,888 KB
testcase_34 AC 271 ms
78,036 KB
testcase_35 AC 1,211 ms
82,968 KB
testcase_36 AC 39 ms
53,948 KB
testcase_37 AC 39 ms
55,008 KB
testcase_38 AC 38 ms
54,464 KB
testcase_39 AC 39 ms
53,968 KB
testcase_40 AC 45 ms
61,292 KB
testcase_41 AC 39 ms
53,796 KB
testcase_42 AC 41 ms
54,924 KB
testcase_43 AC 85 ms
76,320 KB
testcase_44 AC 202 ms
77,340 KB
testcase_45 AC 63 ms
73,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #




H, W = map(int, input().split())

S = [[1 if i == '#' else 0 for i in input()] for _ in range(H)]

from copy import deepcopy

for i in range(H):
    
    for j in range(-W + 1, W):
        
        if i == 0 and j <= 0:
            
            
            continue
        
        
        else:
            
            s = deepcopy(S)
            
            B = True
            
            for h in range(H):
                
                if B:
                    
                    
                    for w in range(W):
                    
                      if s[h][w] == 1:
                          
                          s[h][w] = 0
                          
                          if h + i < H and 0 <= w + j < W and s[h + i][w + j]:
                              
                              s[h + i][w + j] = 0
                              
                              
                          else:
                              
                              B = False
                              
                              break
                          
                          
                else:
                    
                    break
                
            if B:
                
                print('YES')
                
                exit()
                
                
               
if H == 1 and W == 1 and S[0][0] == 0:
    
    print('YES')
    
else:
    print('NO')
0