結果

問題 No.232 めぐるはめぐる (2)
ユーザー maimai
提出日時 2016-01-23 11:50:06
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 16,224 KB
最終ジャッジ日時 2023-10-21 13:49:11
合計ジャッジ時間 3,494 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
16,224 KB
testcase_01 AC 115 ms
16,224 KB
testcase_02 AC 112 ms
16,224 KB
testcase_03 AC 115 ms
16,224 KB
testcase_04 AC 78 ms
16,108 KB
testcase_05 WA -
testcase_06 AC 73 ms
16,108 KB
testcase_07 AC 71 ms
16,108 KB
testcase_08 AC 102 ms
16,224 KB
testcase_09 AC 70 ms
16,108 KB
testcase_10 AC 71 ms
16,108 KB
testcase_11 AC 70 ms
16,108 KB
testcase_12 AC 72 ms
16,108 KB
testcase_13 WA -
testcase_14 AC 75 ms
16,108 KB
testcase_15 AC 74 ms
16,108 KB
testcase_16 AC 70 ms
16,108 KB
testcase_17 AC 80 ms
16,104 KB
testcase_18 AC 74 ms
16,108 KB
testcase_19 AC 75 ms
16,108 KB
testcase_20 AC 75 ms
16,108 KB
testcase_21 AC 69 ms
16,108 KB
testcase_22 AC 71 ms
16,108 KB
testcase_23 AC 72 ms
16,108 KB
testcase_24 AC 77 ms
16,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

t,a,b=gets.split(" ").map(&:to_i)
min = a > b ? a : b
if t < min
    puts "NO"
    exit
end
puts "YES"
while t > min+1
    t-=2
    puts ">"
    puts "<"
end
if t > min
    t-=2
    if a!=0 && b!=0
        a-=1;b-=1
        puts ">"
        puts "^"
    else
        puts "^>"
        puts "<" if b==0
        puts "v" if a==0
    end
end
while t > 0
    t-=1
    if a!=0 && b!=0
        puts "^>"
    else
        puts "^" if b==0
        puts ">" if a==0
    end
    a-=1 if a>0
    b-=1 if b>0
end
0