結果

問題 No.232 めぐるはめぐる (2)
ユーザー cielciel
提出日時 2015-06-27 01:23:24
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 533 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 11,588 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2023-09-22 03:02:13
合計ジャッジ時間 4,490 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
15,448 KB
testcase_01 AC 139 ms
15,348 KB
testcase_02 AC 138 ms
15,452 KB
testcase_03 AC 138 ms
15,360 KB
testcase_04 AC 88 ms
15,272 KB
testcase_05 AC 85 ms
15,128 KB
testcase_06 AC 86 ms
15,076 KB
testcase_07 AC 86 ms
15,136 KB
testcase_08 AC 124 ms
15,272 KB
testcase_09 AC 86 ms
15,280 KB
testcase_10 AC 90 ms
15,236 KB
testcase_11 AC 86 ms
15,288 KB
testcase_12 AC 85 ms
15,272 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 85 ms
15,160 KB
testcase_16 AC 83 ms
15,316 KB
testcase_17 WA -
testcase_18 AC 89 ms
15,184 KB
testcase_19 AC 88 ms
15,264 KB
testcase_20 AC 87 ms
15,340 KB
testcase_21 AC 86 ms
15,260 KB
testcase_22 AC 89 ms
15,284 KB
testcase_23 AC 87 ms
15,144 KB
testcase_24 AC 86 ms
15,040 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
	elsif (t-a-b)%2==0 and t>a+b
		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