結果

問題 No.86 TVザッピング(2)
ユーザー gigurururugigurururu
提出日時 2014-12-05 00:07:57
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 205 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,288 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2023-09-02 08:42:42
合計ジャッジ時間 4,349 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,052 KB
testcase_01 WA -
testcase_02 AC 83 ms
15,268 KB
testcase_03 AC 83 ms
15,268 KB
testcase_04 AC 83 ms
15,260 KB
testcase_05 AC 86 ms
15,288 KB
testcase_06 AC 82 ms
15,096 KB
testcase_07 WA -
testcase_08 AC 87 ms
15,252 KB
testcase_09 WA -
testcase_10 AC 101 ms
15,408 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 88 ms
15,432 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 82 ms
15,176 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 98 ms
15,396 KB
testcase_22 AC 81 ms
15,260 KB
testcase_23 AC 89 ms
15,304 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 82 ms
15,136 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 80 ms
15,168 KB
testcase_31 WA -
testcase_32 AC 81 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
l=(1..n).map{gets+?#}+[?#*m]
q=(0...n).map{|i|(0...m).count{|j|l[i][j]!=?#&&[[i+1,j],[i-1,j],[i,j+1],[i,j-1]].count{|a,b|l[a][b]==?.}%2>0}}.inject(:+)
puts q==0||q==2?:YES:"NO"
0