結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
15,440 KB
testcase_01 AC 153 ms
15,420 KB
testcase_02 WA -
testcase_03 AC 149 ms
15,432 KB
testcase_04 AC 93 ms
15,352 KB
testcase_05 AC 92 ms
15,184 KB
testcase_06 AC 95 ms
15,048 KB
testcase_07 AC 93 ms
15,304 KB
testcase_08 AC 131 ms
15,484 KB
testcase_09 AC 88 ms
15,168 KB
testcase_10 WA -
testcase_11 AC 86 ms
15,244 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 88 ms
15,304 KB
testcase_16 AC 88 ms
15,200 KB
testcase_17 AC 89 ms
15,288 KB
testcase_18 AC 88 ms
15,152 KB
testcase_19 AC 85 ms
15,152 KB
testcase_20 AC 85 ms
15,268 KB
testcase_21 WA -
testcase_22 AC 86 ms
15,272 KB
testcase_23 AC 85 ms
15,156 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
	n=[a,b].min
	if n%2>0
		output '^'
		output '>'
	end
	(n-n%2).times{
		output '^>'
	}
	a-=n+n%2
	b-=n+n%2
	a.times{
		output '^'
	}
	b.times{
		output '>'
	}
	((t-$lineno)/2).times{
		output '^'
		output 'v'
	}
end
0