結果

問題 No.179 塗り分け
ユーザー LaLa
提出日時 2020-11-25 17:51:33
言語 Ruby
(3.2.2)
結果
WA  
実行時間 -
コード長 832 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 26,540 KB
最終ジャッジ日時 2023-10-01 01:50:41
合計ジャッジ時間 16,669 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,276 KB
testcase_01 AC 83 ms
15,048 KB
testcase_02 AC 88 ms
15,372 KB
testcase_03 AC 84 ms
15,044 KB
testcase_04 AC 90 ms
15,284 KB
testcase_05 AC 1,600 ms
16,388 KB
testcase_06 AC 849 ms
15,576 KB
testcase_07 WA -
testcase_08 AC 2,593 ms
26,272 KB
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

H,W=gets.split.map(&:to_i)
S=Array.new(H)

for i in 0...H do
    S[i]=gets.chomp
end

CAN=false

for i in 0...H do
    for j in 0...W do
        next if i==0 && j==0
        COIN=true
        
        T=Array.new(H).map{Array.new(W,0)}
        for ii in 0...H do
            for jj in 0...W do
                T[ii][jj]=1 if S[ii][jj]=='#'
            end
        end
        
        for ii in 0...H do
            for jj in 0...W do
                if T[ii][jj]==1
                    if ii+i>=H || jj+j>=W
                        COIN=false
                        next
                    end
                    COIN=false if T[ii+i][jj+j]!=1
                    T[ii][jj]=0
                    T[ii+i][jj+j]=0
                end
            end
        end
        
        CAN=true if COIN
    end
end

puts CAN ? "YES":"NO"
0