結果

問題 No.378 名声値を稼ごう
ユーザー basie23basie23
提出日時 2016-12-21 15:06:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 131 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 11,224 KB
実行使用メモリ 15,320 KB
最終ジャッジ日時 2023-09-12 09:13:19
合計ジャッジ時間 1,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,268 KB
testcase_01 AC 80 ms
15,128 KB
testcase_02 AC 80 ms
15,108 KB
testcase_03 AC 82 ms
15,320 KB
testcase_04 AC 81 ms
15,232 KB
testcase_05 AC 79 ms
15,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
first = n
sc = 2 * n
sum = 0

while n >= 1 do
n = n / 2
n = n.floor
sum = sum + n
end


puts sc - (sum + first)
0