結果

問題 No.149 碁石の移動
ユーザー simansiman
提出日時 2015-03-30 03:03:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 11,244 KB
実行使用メモリ 15,300 KB
最終ジャッジ日時 2023-08-25 17:29:22
合計ジャッジ時間 2,647 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,108 KB
testcase_01 AC 82 ms
15,216 KB
testcase_02 AC 81 ms
15,132 KB
testcase_03 AC 87 ms
15,092 KB
testcase_04 AC 82 ms
15,152 KB
testcase_05 AC 82 ms
15,204 KB
testcase_06 AC 82 ms
15,296 KB
testcase_07 AC 82 ms
15,248 KB
testcase_08 AC 81 ms
15,220 KB
testcase_09 AC 83 ms
15,208 KB
testcase_10 AC 82 ms
15,192 KB
testcase_11 AC 81 ms
15,048 KB
testcase_12 AC 81 ms
15,104 KB
testcase_13 AC 83 ms
15,088 KB
testcase_14 AC 81 ms
15,300 KB
testcase_15 AC 82 ms
15,108 KB
testcase_16 AC 83 ms
15,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - bb
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    aw, ab = gets.chomp.split(' ').map(&:to_i)
    bw, bb = gets.chomp.split(' ').map(&:to_i)
    c, d   = gets.chomp.split(' ').map(&:to_i)

    mw1 = [aw, [0, (c - ab)].max].min

    aw -= mw1
    bw += mw1

    mw2 = [bw, d].min

    aw += mw2
    bw -= mw2

    puts aw
  end
end

Yukicoder.new
0