結果

問題 No.480 合計
ユーザー hum_ophum_op
提出日時 2017-04-16 20:54:08
言語 F#
(F# 4.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 3,895 ms
コンパイル使用メモリ 163,140 KB
実行使用メモリ 24,856 KB
最終ジャッジ日時 2023-08-21 01:42:32
合計ジャッジ時間 6,359 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
22,704 KB
testcase_01 AC 78 ms
20,716 KB
testcase_02 AC 81 ms
22,708 KB
testcase_03 AC 79 ms
24,740 KB
testcase_04 AC 78 ms
22,784 KB
testcase_05 AC 77 ms
24,808 KB
testcase_06 AC 80 ms
22,628 KB
testcase_07 AC 79 ms
22,740 KB
testcase_08 AC 78 ms
22,796 KB
testcase_09 AC 79 ms
22,680 KB
testcase_10 AC 79 ms
22,692 KB
testcase_11 AC 80 ms
24,856 KB
testcase_12 AC 80 ms
22,784 KB
testcase_13 AC 81 ms
24,732 KB
testcase_14 AC 79 ms
22,844 KB
testcase_15 AC 79 ms
24,828 KB
testcase_16 AC 79 ms
22,780 KB
testcase_17 AC 79 ms
22,852 KB
testcase_18 AC 80 ms
20,636 KB
testcase_19 AC 79 ms
22,672 KB
testcase_20 AC 79 ms
22,924 KB
testcase_21 AC 84 ms
22,864 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let No480 () =
    let N = int <| Console.ReadLine()
    let rec sum (n : int) (s : int) =
        if n > 0 then
            sum (n - 1) ( s + n )
        else 
            s

    printfn "%d" <| sum N 0

    ()

No480 ()
0