結果

問題 No.91 赤、緑、青の石
ユーザー DialBirdDialBird
提出日時 2017-03-09 07:02:29
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,489 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 11,348 KB
実行使用メモリ 15,476 KB
最終ジャッジ日時 2023-09-06 12:28:26
合計ジャッジ時間 17,617 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,013 ms
15,368 KB
testcase_01 AC 691 ms
15,136 KB
testcase_02 AC 463 ms
15,212 KB
testcase_03 AC 790 ms
15,212 KB
testcase_04 AC 422 ms
15,220 KB
testcase_05 AC 917 ms
15,132 KB
testcase_06 AC 310 ms
15,172 KB
testcase_07 AC 81 ms
15,100 KB
testcase_08 AC 81 ms
15,124 KB
testcase_09 AC 81 ms
15,040 KB
testcase_10 AC 80 ms
15,124 KB
testcase_11 AC 314 ms
15,156 KB
testcase_12 AC 842 ms
15,240 KB
testcase_13 AC 904 ms
15,316 KB
testcase_14 AC 632 ms
15,360 KB
testcase_15 AC 966 ms
15,408 KB
testcase_16 AC 81 ms
15,264 KB
testcase_17 AC 81 ms
15,204 KB
testcase_18 AC 80 ms
15,204 KB
testcase_19 AC 81 ms
15,248 KB
testcase_20 AC 82 ms
15,252 KB
testcase_21 AC 82 ms
15,148 KB
testcase_22 AC 83 ms
15,108 KB
testcase_23 AC 81 ms
15,368 KB
testcase_24 AC 82 ms
15,312 KB
testcase_25 AC 1,489 ms
15,476 KB
testcase_26 AC 1,388 ms
15,320 KB
testcase_27 AC 81 ms
15,308 KB
testcase_28 AC 195 ms
15,192 KB
testcase_29 AC 324 ms
15,240 KB
testcase_30 AC 1,003 ms
15,252 KB
testcase_31 AC 1,348 ms
15,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    @stones = gets.chomp.split.map(&:to_i)
  end

  def run
    @stones.sort!
    while @stones[-1] - @stones[0] >= 3
      @stones[-1] -= 2
      @stones[0] += 1
      @stones.sort!
    end
    @stones.min
  end

end

puts Yukicoder.new.run
0