結果

問題 No.71 そろばん
ユーザー gemmarogemmaro
提出日時 2020-08-17 14:02:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 154 ms / 5,000 ms
コード長 131 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 18,432 KB
最終ジャッジ日時 2024-04-19 18:51:07
合計ジャッジ時間 4,020 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
12,288 KB
testcase_01 AC 84 ms
12,288 KB
testcase_02 AC 154 ms
18,432 KB
testcase_03 AC 122 ms
16,128 KB
testcase_04 AC 124 ms
16,896 KB
testcase_05 AC 141 ms
17,792 KB
testcase_06 AC 146 ms
18,432 KB
testcase_07 AC 127 ms
17,024 KB
testcase_08 AC 116 ms
16,256 KB
testcase_09 AC 146 ms
18,176 KB
testcase_10 AC 125 ms
16,768 KB
testcase_11 AC 94 ms
12,416 KB
testcase_12 AC 106 ms
14,080 KB
testcase_13 AC 151 ms
18,304 KB
testcase_14 AC 113 ms
16,128 KB
testcase_15 AC 136 ms
17,536 KB
testcase_16 AC 94 ms
12,672 KB
testcase_17 AC 114 ms
16,256 KB
testcase_18 AC 139 ms
17,664 KB
testcase_19 AC 150 ms
18,304 KB
testcase_20 AC 147 ms
18,048 KB
testcase_21 AC 120 ms
16,128 KB
testcase_22 AC 130 ms
17,280 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve
  (0..(N / 2)).map { |a| (a + 1) * ((N - a) + 1) }.max - 1
end

N = gets.to_i

puts solve
0