結果

問題 No.232 めぐるはめぐる (2)
ユーザー cielciel
提出日時 2015-06-27 01:30:57
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 401 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 11,500 KB
実行使用メモリ 23,128 KB
最終ジャッジ日時 2023-09-22 03:02:35
合計ジャッジ時間 4,524 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
23,128 KB
testcase_01 RE -
testcase_02 AC 128 ms
22,932 KB
testcase_03 RE -
testcase_04 AC 78 ms
15,056 KB
testcase_05 AC 80 ms
15,076 KB
testcase_06 AC 77 ms
15,276 KB
testcase_07 AC 78 ms
15,340 KB
testcase_08 RE -
testcase_09 AC 79 ms
15,112 KB
testcase_10 RE -
testcase_11 AC 76 ms
15,288 KB
testcase_12 AC 80 ms
15,252 KB
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 79 ms
15,284 KB
testcase_19 AC 78 ms
15,108 KB
testcase_20 AC 77 ms
15,280 KB
testcase_21 AC 78 ms
15,208 KB
testcase_22 RE -
testcase_23 AC 78 ms
15,188 KB
testcase_24 AC 80 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

T,a,b=gets.split.map &:to_i
if [a,b].max>T || (T==1 && a+b==0)
	puts :NO
else
	puts :YES
	r=[]
	if a==0 && (b-T)%2>0
		r<<'^'
		r<<'v>'
		b-=1
	elsif b==0 && (a-T)%2>0
		r<<'>'
		r<<'<^'
		a-=1
	elsif a+b>0 && (T-a-b)%2==0 && t>a+b
		r<<'>'
		r<<'^'
		a-=1
		b-=1
	end
	n=[a,b].min
	n.times{r<<'^>'}
	a-=n
	b-=n
	a.times{r<<'^'}
	b.times{r<<'>'}
	((T-r.size)/2).times{
		r<<'^'
		r<<'v'
	}
	puts r
end
0