結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
15,448 KB
testcase_01 AC 130 ms
15,308 KB
testcase_02 AC 126 ms
15,260 KB
testcase_03 AC 128 ms
15,400 KB
testcase_04 AC 77 ms
15,168 KB
testcase_05 AC 79 ms
15,180 KB
testcase_06 AC 78 ms
15,148 KB
testcase_07 AC 77 ms
15,132 KB
testcase_08 AC 114 ms
15,240 KB
testcase_09 AC 77 ms
15,188 KB
testcase_10 AC 77 ms
15,040 KB
testcase_11 AC 77 ms
15,164 KB
testcase_12 AC 78 ms
15,284 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 78 ms
15,272 KB
testcase_16 AC 77 ms
15,240 KB
testcase_17 WA -
testcase_18 AC 81 ms
15,152 KB
testcase_19 AC 79 ms
15,128 KB
testcase_20 AC 80 ms
15,184 KB
testcase_21 AC 78 ms
15,168 KB
testcase_22 AC 77 ms
15,272 KB
testcase_23 AC 79 ms
15,044 KB
testcase_24 AC 77 ms
15,132 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 && a==0 && b==0)
	puts :NO
else
	puts :YES
	if a==0 && (b-t)%2>0
		output '^'
		output 'v>'
		b-=1
	elsif b==0 && (a-t)%2>0
		output '>'
		output '<^'
		a-=1
	elsif a+b>0 && (t-a-b)%2==0 && 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