結果

問題 No.3069 Torn Documents
ユーザー cielciel
提出日時 2020-10-26 19:26:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 16,756 KB
最終ジャッジ日時 2023-09-29 02:56:40
合計ジャッジ時間 4,416 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
16,756 KB
testcase_01 AC 104 ms
16,108 KB
testcase_02 AC 85 ms
15,276 KB
testcase_03 AC 83 ms
15,152 KB
testcase_04 AC 84 ms
15,212 KB
testcase_05 AC 84 ms
15,056 KB
testcase_06 AC 83 ms
14,988 KB
testcase_07 AC 84 ms
15,200 KB
testcase_08 AC 89 ms
15,148 KB
testcase_09 AC 86 ms
15,148 KB
testcase_10 AC 86 ms
15,072 KB
testcase_11 AC 108 ms
16,116 KB
testcase_12 AC 85 ms
15,012 KB
testcase_13 AC 84 ms
15,128 KB
testcase_14 AC 85 ms
15,056 KB
testcase_15 AC 84 ms
15,268 KB
testcase_16 AC 85 ms
15,084 KB
testcase_17 AC 87 ms
15,108 KB
testcase_18 AC 87 ms
15,104 KB
testcase_19 AC 84 ms
15,048 KB
testcase_20 AC 84 ms
15,256 KB
testcase_21 AC 83 ms
15,128 KB
testcase_22 AC 83 ms
15,108 KB
testcase_23 AC 85 ms
15,084 KB
testcase_24 AC 84 ms
15,104 KB
testcase_25 AC 83 ms
15,100 KB
testcase_26 AC 83 ms
15,104 KB
testcase_27 AC 82 ms
15,324 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]/,'')
	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.sort.map{|e|e*' '}
end
0