結果

問題 No.232 めぐるはめぐる (2)
ユーザー cielciel
提出日時 2015-06-27 00:47:33
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 11,396 KB
実行使用メモリ 15,480 KB
最終ジャッジ日時 2023-09-22 02:56:34
合計ジャッジ時間 5,772 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 137 ms
15,192 KB
testcase_03 WA -
testcase_04 AC 85 ms
15,264 KB
testcase_05 AC 87 ms
15,208 KB
testcase_06 WA -
testcase_07 AC 85 ms
15,148 KB
testcase_08 WA -
testcase_09 AC 87 ms
15,332 KB
testcase_10 AC 88 ms
15,268 KB
testcase_11 WA -
testcase_12 AC 86 ms
15,152 KB
testcase_13 WA -
testcase_14 AC 84 ms
15,052 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 88 ms
15,316 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 86 ms
15,152 KB
testcase_22 AC 87 ms
15,156 KB
testcase_23 AC 88 ms
15,068 KB
testcase_24 AC 87 ms
15,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
$lineno=0
def output(s)
	puts s
	$lineno+=1
end
t,a,b=gets.split.map &:to_i
if [a,b].max>t || (t==1 and a==0 and b==0)
	puts :NO
else
	puts :YES
	if a==0
		if (b-t)%2>0
			output '^'
			output 'v>'
			b-=1
		end
	elsif b==0
		if (a-t)%2>0
			output '>'
			output '<^'
			a-=1
		end
	end
	if (a+b-t)%2==0
		output '^'
		output '>'
		a-=1
		b-=1
	end
	n=[a,b].min
	n.times{
		output '^>'
	}
	a-=n
	b-=n
	a.times{
		output '^'
	}
	b.times{
		output '>'
	}
	((t-$lineno)/2).times{
		output '^'
		output 'v'
	}
end
0