結果

問題 No.232 めぐるはめぐる (2)
ユーザー simansiman
提出日時 2016-03-26 20:18:34
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 762 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 21,120 KB
最終ジャッジ日時 2024-04-10 00:03:38
合計ジャッジ時間 4,809 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
21,120 KB
testcase_01 AC 115 ms
13,184 KB
testcase_02 AC 154 ms
21,120 KB
testcase_03 AC 118 ms
12,928 KB
testcase_04 AC 83 ms
12,160 KB
testcase_05 RE -
testcase_06 AC 84 ms
12,160 KB
testcase_07 AC 84 ms
12,288 KB
testcase_08 AC 107 ms
12,928 KB
testcase_09 AC 81 ms
12,160 KB
testcase_10 WA -
testcase_11 RE -
testcase_12 AC 83 ms
12,288 KB
testcase_13 RE -
testcase_14 WA -
testcase_15 AC 82 ms
12,288 KB
testcase_16 AC 88 ms
12,288 KB
testcase_17 AC 87 ms
12,288 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 85 ms
12,416 KB
testcase_22 AC 85 ms
12,288 KB
testcase_23 AC 86 ms
12,160 KB
testcase_24 AC 86 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    t, y, x = gets.chomp.split.map(&:to_i)
    m = [y,x].max
    n = [y,x].min

    answer = []

    if m > t
      puts "NO"
      return
    else
      while t > m+1
        answer << %w(> <)
        t -= 2
      end

      if (t-m).odd?
        answer << %w(^ >)
        answer << %w(^>) * (n-1)
        y -= n
        x -= n

        if y == 0 && x > 0
          answer << %w(>) * (t-n)
        elsif y > 0
          answer << %w(^) * (t-n)
        end
      else
        answer << %w(^>) * n
        y -= n
        x -= n

        if y == 0 && x > 0
          answer << %w(>) * (t-n)
        elsif y > 0
          answer << %w(^) * (t-n)
        end
      end
    end

    puts "YES"
    puts answer
  end
end

Yukicoder.new
0