結果

問題 No.71 そろばん
ユーザー DialBirdDialBird
提出日時 2017-02-20 21:01:31
言語 Ruby
(3.3.0)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 15,308 KB
最終ジャッジ日時 2023-08-28 21:39:16
合計ジャッジ時間 3,871 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
15,072 KB
testcase_01 AC 84 ms
15,120 KB
testcase_02 AC 126 ms
15,116 KB
testcase_03 AC 99 ms
15,216 KB
testcase_04 AC 106 ms
15,304 KB
testcase_05 AC 119 ms
15,120 KB
testcase_06 AC 125 ms
15,256 KB
testcase_07 AC 112 ms
15,028 KB
testcase_08 AC 103 ms
15,160 KB
testcase_09 AC 123 ms
15,176 KB
testcase_10 AC 107 ms
15,164 KB
testcase_11 AC 87 ms
15,120 KB
testcase_12 AC 95 ms
15,132 KB
testcase_13 AC 125 ms
15,240 KB
testcase_14 AC 101 ms
15,072 KB
testcase_15 AC 118 ms
15,256 KB
testcase_16 AC 89 ms
15,032 KB
testcase_17 AC 104 ms
15,136 KB
testcase_18 AC 117 ms
15,028 KB
testcase_19 AC 124 ms
15,032 KB
testcase_20 AC 125 ms
15,308 KB
testcase_21 AC 102 ms
15,116 KB
testcase_22 AC 112 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    @n = gets.to_i
  end

  def run
    max = 0
    0.upto(@n) do |i|
      atai = (i + 1) * (@n - i) + i
      break if atai <= max
      max = atai
    end

    return max
  end
end

puts Yukicoder.new.run
0