結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,888 KB
testcase_01 AC 39 ms
54,016 KB
testcase_02 AC 38 ms
53,632 KB
testcase_03 AC 38 ms
53,632 KB
testcase_04 AC 38 ms
54,656 KB
testcase_05 AC 193 ms
78,208 KB
testcase_06 AC 44 ms
53,888 KB
testcase_07 WA -
testcase_08 AC 868 ms
80,420 KB
testcase_09 AC 845 ms
80,564 KB
testcase_10 AC 56 ms
63,744 KB
testcase_11 AC 54 ms
63,616 KB
testcase_12 AC 973 ms
83,564 KB
testcase_13 AC 53 ms
66,176 KB
testcase_14 AC 51 ms
67,968 KB
testcase_15 AC 38 ms
53,248 KB
testcase_16 AC 40 ms
53,888 KB
testcase_17 AC 39 ms
53,376 KB
testcase_18 AC 88 ms
76,928 KB
testcase_19 AC 90 ms
76,928 KB
testcase_20 AC 937 ms
82,816 KB
testcase_21 AC 939 ms
81,792 KB
testcase_22 AC 929 ms
81,596 KB
testcase_23 AC 52 ms
64,128 KB
testcase_24 AC 927 ms
81,508 KB
testcase_25 AC 62 ms
71,744 KB
testcase_26 AC 219 ms
78,052 KB
testcase_27 AC 1,007 ms
82,008 KB
testcase_28 AC 102 ms
76,692 KB
testcase_29 AC 1,053 ms
82,944 KB
testcase_30 AC 489 ms
80,000 KB
testcase_31 AC 1,062 ms
82,700 KB
testcase_32 AC 343 ms
78,720 KB
testcase_33 AC 1,048 ms
83,100 KB
testcase_34 AC 266 ms
78,140 KB
testcase_35 AC 1,077 ms
83,380 KB
testcase_36 AC 40 ms
53,376 KB
testcase_37 AC 40 ms
53,760 KB
testcase_38 AC 40 ms
53,888 KB
testcase_39 AC 40 ms
53,632 KB
testcase_40 AC 45 ms
61,056 KB
testcase_41 AC 37 ms
53,760 KB
testcase_42 AC 40 ms
54,272 KB
testcase_43 AC 79 ms
76,380 KB
testcase_44 AC 209 ms
77,436 KB
testcase_45 AC 66 ms
72,960 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()
                
                
                
print('NO')
0