結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
16,132 KB
testcase_01 AC 143 ms
16,132 KB
testcase_02 AC 132 ms
16,132 KB
testcase_03 AC 137 ms
16,132 KB
testcase_04 AC 87 ms
16,020 KB
testcase_05 WA -
testcase_06 AC 87 ms
16,020 KB
testcase_07 AC 89 ms
16,020 KB
testcase_08 AC 123 ms
16,132 KB
testcase_09 AC 89 ms
16,020 KB
testcase_10 AC 88 ms
16,020 KB
testcase_11 AC 87 ms
16,020 KB
testcase_12 AC 88 ms
16,020 KB
testcase_13 AC 88 ms
16,020 KB
testcase_14 AC 88 ms
16,020 KB
testcase_15 AC 88 ms
16,020 KB
testcase_16 AC 90 ms
16,020 KB
testcase_17 AC 89 ms
16,020 KB
testcase_18 AC 90 ms
16,020 KB
testcase_19 AC 88 ms
16,020 KB
testcase_20 AC 89 ms
16,020 KB
testcase_21 AC 88 ms
16,020 KB
testcase_22 AC 91 ms
16,020 KB
testcase_23 AC 88 ms
16,020 KB
testcase_24 AC 88 ms
16,020 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"
if min==0
    if t<=1
        puts "NO"
    else
        while t > 0
            if t == 3
                puts "^>"
                puts "v"
                puts "<"
                exit
            end
            t-=2
            puts ">"
            puts "<"
        end
    end
    exit
end
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