結果

問題 No.71 そろばん
ユーザー shi-moshi-mo
提出日時 2016-10-23 01:53:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 190 ms / 5,000 ms
コード長 105 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-02 22:39:04
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
12,160 KB
testcase_01 AC 90 ms
12,288 KB
testcase_02 AC 189 ms
12,160 KB
testcase_03 AC 127 ms
12,160 KB
testcase_04 AC 149 ms
12,160 KB
testcase_05 AC 177 ms
12,160 KB
testcase_06 AC 187 ms
12,288 KB
testcase_07 AC 155 ms
12,032 KB
testcase_08 AC 135 ms
12,288 KB
testcase_09 AC 184 ms
12,160 KB
testcase_10 AC 151 ms
12,160 KB
testcase_11 AC 103 ms
12,288 KB
testcase_12 AC 123 ms
12,032 KB
testcase_13 AC 190 ms
12,160 KB
testcase_14 AC 132 ms
12,032 KB
testcase_15 AC 170 ms
12,032 KB
testcase_16 AC 101 ms
12,160 KB
testcase_17 AC 139 ms
12,160 KB
testcase_18 AC 173 ms
12,160 KB
testcase_19 AC 187 ms
12,160 KB
testcase_20 AC 186 ms
12,288 KB
testcase_21 AC 132 ms
12,160 KB
testcase_22 AC 160 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

x = 1
1.upto(n-1) do |a|
  b = n - a
  x_ = (a+1) * (b+1) - 1
  x = [x, x_].max
end
puts x
0