結果

問題 No.480 合計
ユーザー nohopennohopen
提出日時 2019-06-09 12:08:53
言語 F#
(.NET 7)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 3,746 ms
コンパイル使用メモリ 161,080 KB
実行使用メモリ 24,908 KB
最終ジャッジ日時 2023-07-28 11:21:59
合計ジャッジ時間 6,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
22,816 KB
testcase_01 AC 82 ms
22,756 KB
testcase_02 AC 82 ms
22,760 KB
testcase_03 AC 82 ms
24,744 KB
testcase_04 AC 82 ms
24,744 KB
testcase_05 AC 80 ms
22,816 KB
testcase_06 AC 80 ms
22,780 KB
testcase_07 AC 81 ms
22,720 KB
testcase_08 AC 81 ms
22,936 KB
testcase_09 AC 82 ms
22,700 KB
testcase_10 AC 84 ms
24,908 KB
testcase_11 AC 83 ms
22,764 KB
testcase_12 AC 81 ms
22,828 KB
testcase_13 AC 81 ms
22,744 KB
testcase_14 AC 81 ms
24,788 KB
testcase_15 AC 80 ms
20,720 KB
testcase_16 AC 81 ms
22,732 KB
testcase_17 AC 82 ms
22,796 KB
testcase_18 AC 82 ms
24,780 KB
testcase_19 AC 82 ms
22,708 KB
testcase_20 AC 82 ms
22,764 KB
testcase_21 AC 81 ms
22,924 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 sum n = 
  let rec loop(n, ans) =
    if n < 0 then ans
    else loop((n-1), n+ans)
  in
    loop(n, 0)

let n = int(Console.ReadLine())
printfn "%d" (sum n)
0