結果

問題 No.3069 Torn Documents
ユーザー cielciel
提出日時 2020-10-26 19:10:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,228 KB
実行使用メモリ 16,752 KB
最終ジャッジ日時 2023-09-29 02:56:58
合計ジャッジ時間 5,945 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 83 ms
15,136 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 84 ms
15,276 KB
testcase_06 WA -
testcase_07 AC 83 ms
15,108 KB
testcase_08 WA -
testcase_09 AC 81 ms
15,172 KB
testcase_10 AC 82 ms
15,024 KB
testcase_11 AC 111 ms
16,248 KB
testcase_12 AC 83 ms
15,284 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 84 ms
15,288 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 81 ms
15,012 KB
testcase_21 AC 83 ms
15,276 KB
testcase_22 WA -
testcase_23 AC 83 ms
15,240 KB
testcase_24 AC 83 ms
15,136 KB
testcase_25 AC 85 ms
15,072 KB
testcase_26 AC 83 ms
15,008 KB
testcase_27 AC 83 ms
15,252 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

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?('U')
	puts r.map{|e|e*' '}
end
0