結果

問題 No.51 やる気の問題
ユーザー Naoki_M_Naoki_M_
提出日時 2015-11-06 13:40:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 103 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 17,048 KB
最終ジャッジ日時 2023-10-11 14:20:39
合計ジャッジ時間 3,354 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,176 KB
testcase_01 AC 77 ms
15,128 KB
testcase_02 AC 77 ms
15,140 KB
testcase_03 AC 78 ms
15,180 KB
testcase_04 AC 78 ms
15,024 KB
testcase_05 AC 94 ms
16,284 KB
testcase_06 AC 86 ms
15,916 KB
testcase_07 AC 87 ms
16,072 KB
testcase_08 AC 86 ms
15,684 KB
testcase_09 AC 100 ms
17,048 KB
testcase_10 AC 87 ms
15,764 KB
testcase_11 AC 87 ms
15,672 KB
testcase_12 AC 92 ms
15,892 KB
testcase_13 AC 90 ms
15,896 KB
testcase_14 AC 88 ms
15,712 KB
testcase_15 AC 93 ms
16,412 KB
testcase_16 AC 82 ms
15,404 KB
testcase_17 AC 78 ms
15,124 KB
testcase_18 AC 93 ms
16,772 KB
testcase_19 AC 92 ms
16,508 KB
testcase_20 AC 86 ms
16,188 KB
testcase_21 AC 79 ms
15,316 KB
testcase_22 AC 96 ms
16,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w = gets.chomp.to_i
d = gets.chomp.to_i

puts (2..d).to_a.reverse.inject (w) { |m, x| m - m / (x** 2) }
0