結果

問題 No.179 塗り分け
ユーザー LaLa
提出日時 2020-11-25 17:50:25
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 828 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 11,384 KB
実行使用メモリ 26,640 KB
最終ジャッジ日時 2023-10-01 01:50:21
合計ジャッジ時間 18,316 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
19,732 KB
testcase_01 WA -
testcase_02 AC 84 ms
15,000 KB
testcase_03 WA -
testcase_04 AC 87 ms
15,280 KB
testcase_05 WA -
testcase_06 AC 857 ms
15,472 KB
testcase_07 WA -
testcase_08 AC 2,549 ms
26,228 KB
testcase_09 AC 2,554 ms
26,180 KB
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=1
                        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