結果

問題 No.86 TVザッピング(2)
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-20 21:50:04
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 11,532 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2023-09-06 02:34:30
合計ジャッジ時間 6,474 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,308 KB
testcase_01 AC 83 ms
15,428 KB
testcase_02 AC 86 ms
15,172 KB
testcase_03 WA -
testcase_04 AC 83 ms
15,236 KB
testcase_05 AC 82 ms
15,064 KB
testcase_06 WA -
testcase_07 AC 83 ms
15,248 KB
testcase_08 WA -
testcase_09 AC 93 ms
15,452 KB
testcase_10 AC 98 ms
15,212 KB
testcase_11 AC 85 ms
15,312 KB
testcase_12 AC 83 ms
15,288 KB
testcase_13 AC 84 ms
15,144 KB
testcase_14 AC 84 ms
15,280 KB
testcase_15 AC 97 ms
15,240 KB
testcase_16 AC 97 ms
15,324 KB
testcase_17 AC 83 ms
15,220 KB
testcase_18 AC 85 ms
15,264 KB
testcase_19 AC 87 ms
15,408 KB
testcase_20 AC 83 ms
15,412 KB
testcase_21 AC 782 ms
15,196 KB
testcase_22 AC 83 ms
15,320 KB
testcase_23 AC 86 ms
15,280 KB
testcase_24 AC 82 ms
15,108 KB
testcase_25 AC 83 ms
15,140 KB
testcase_26 AC 82 ms
15,156 KB
testcase_27 WA -
testcase_28 AC 83 ms
15,064 KB
testcase_29 AC 1,520 ms
15,372 KB
testcase_30 AC 80 ms
15,304 KB
testcase_31 AC 79 ms
15,108 KB
testcase_32 AC 80 ms
15,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

m,n=gets.split.map &:to_i
# a=(0..m).map{gets}
a=(0...m).map{gets}<<""
f=0
m.times{|p|n.times{|q|
  next if a[p][q]!=?.
  x=p
  y=q
  u=1
  v=0
  f=0
  400.times{
    if a[z=x+v][w=y-u]==?.
      a[x=z][y=w]=?#
      u,v=v,-u
      f+=1
    elsif a[z=x+u][w=y+v]==?.
      a[x=z][y=w]=?#
    elsif a[z=x-v][w=y+u]==?.
      a[x=z][y=w]=?#
      u,v=-v,u
    end
  }
  f+=2 if x!=p||y!=q
}}
puts f==1?:YES: :NO
0