結果
| 問題 | No.455 冬の大三角 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-06 00:16:49 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| 記録 | |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,160 KB |
| 最終ジャッジ日時 | 2024-11-27 22:08:55 |
| 合計ジャッジ時間 | 6,609 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 52 WA * 2 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - h Syntax OK
ソースコード
h,w = gets.split.map(&:to_i)
sky = []
starflg = true
while cin=gets
if starflg && cin=~/(-*)\*\*/
starflg = nil
elsif starflg && cin=~/(-*)\*/
x = $1.size
if x == w-1
cin[x-1] = '*'
else
cin[x+1] = '*'
end
starflg = false
end
sky << cin
end
if starflg == nil
f = true
sky.each{|s|
if f && !(s=~/\*/)
puts "*"+"-"*(w-1)
f = false
else
puts s
end
}
else
puts sky
end