結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
22,928 KB
testcase_01 AC 129 ms
23,156 KB
testcase_02 AC 128 ms
23,104 KB
testcase_03 AC 129 ms
23,004 KB
testcase_04 AC 79 ms
15,040 KB
testcase_05 AC 79 ms
15,092 KB
testcase_06 AC 79 ms
15,272 KB
testcase_07 AC 78 ms
15,144 KB
testcase_08 AC 115 ms
19,900 KB
testcase_09 AC 77 ms
15,148 KB
testcase_10 AC 77 ms
15,096 KB
testcase_11 AC 79 ms
15,248 KB
testcase_12 AC 77 ms
15,132 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 79 ms
15,284 KB
testcase_16 AC 78 ms
15,120 KB
testcase_17 WA -
testcase_18 AC 80 ms
15,096 KB
testcase_19 AC 80 ms
15,184 KB
testcase_20 AC 78 ms
15,144 KB
testcase_21 AC 77 ms
15,140 KB
testcase_22 AC 77 ms
15,344 KB
testcase_23 AC 77 ms
15,176 KB
testcase_24 AC 78 ms
15,132 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