結果
問題 | No.8069 Torn Documents |
ユーザー |
|
提出日時 | 2020-10-26 19:26:31 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 115 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 42 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,800 KB |
最終ジャッジ日時 | 2024-07-21 21:41:39 |
合計ジャッジ時間 | 3,605 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
Main.rb:4: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
a,b=gets.split.map &:to_is=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 -1elsep 6s=s.gsub(/[DR]/,'')a,b=b,a if s.end_with?('L')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