結果

問題 No.378 名声値を稼ごう
ユーザー バカらっくバカらっく
提出日時 2018-03-03 20:23:13
言語 Swift
(5.10.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 121,072 KB
実行使用メモリ 7,808 KB
最終ジャッジ日時 2023-08-20 10:28:26
合計ジャッジ時間 1,606 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,484 KB
testcase_01 AC 3 ms
7,620 KB
testcase_02 AC 3 ms
7,540 KB
testcase_03 AC 3 ms
7,808 KB
testcase_04 AC 3 ms
7,496 KB
testcase_05 AC 4 ms
7,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let inpt = Int(readLine()!)!

func proc1(_ num:Int)->Int {
    var cur = num
    var ret = 0
    repeat {
        ret += cur
        cur /= 2
    } while cur > 0
    return ret
}

let ans = inpt * 2 - proc1(inpt)
print(ans)
0