結果

問題 No.378 名声値を稼ごう
ユーザー xsdxsd
提出日時 2020-06-20 03:06:44
言語 OCaml
(5.1.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 21,444 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 09:00:25
合計ジャッジ時間 695 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%d" (fun n ->
    let sum =
        let rec loop i acc =
            if i = 0 then acc else loop (i / 2) (acc + i)
        in
        loop n 0
    in

    Printf.printf "%d\n" (n * 2 - sum)
)
0