結果

問題 No.71 そろばん
ユーザー shi-moshi-mo
提出日時 2016-10-23 01:53:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 164 ms / 5,000 ms
コード長 105 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 15,352 KB
最終ジャッジ日時 2023-08-15 11:10:44
合計ジャッジ時間 4,113 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,160 KB
testcase_01 AC 72 ms
15,124 KB
testcase_02 AC 160 ms
15,108 KB
testcase_03 AC 108 ms
15,088 KB
testcase_04 AC 125 ms
15,128 KB
testcase_05 AC 149 ms
15,336 KB
testcase_06 AC 160 ms
15,264 KB
testcase_07 AC 130 ms
15,288 KB
testcase_08 AC 114 ms
15,292 KB
testcase_09 AC 164 ms
15,292 KB
testcase_10 AC 123 ms
15,344 KB
testcase_11 AC 88 ms
15,264 KB
testcase_12 AC 102 ms
15,348 KB
testcase_13 AC 162 ms
15,264 KB
testcase_14 AC 109 ms
15,048 KB
testcase_15 AC 139 ms
15,260 KB
testcase_16 AC 84 ms
15,332 KB
testcase_17 AC 112 ms
15,024 KB
testcase_18 AC 149 ms
15,344 KB
testcase_19 AC 157 ms
15,132 KB
testcase_20 AC 162 ms
15,268 KB
testcase_21 AC 108 ms
15,352 KB
testcase_22 AC 131 ms
15,260 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