結果
| 問題 |
No.8069 Torn Documents
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-26 19:06:34 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 317 bytes |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-07-21 21:41:15 |
| 合計ジャッジ時間 | 4,851 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 6 |
コンパイルメッセージ
Main.rb:4: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
a,b=gets.split.map &:to_i
s=gets.chomp.gsub(/[LR]+/){|e|e[-1]}.gsub(/[UD]+/){|e|e[-1]}
if !s.include?('L')||!s.include?('U')||s.end_with?('RD')||s.end_with?('DR')
p -1
else
p 6
s=s.gsub('/[DR]/','')
r=[[0,1],[a+2,0],[a+1,1],[a+1,b],[a,b+1],[a-1,b]]
r=r.map &:reverse if s.end_with?('L')
puts r.map{|e|e*' '}
end