結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー nohopennohopen
提出日時 2019-06-16 16:59:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 217 ms / 3,000 ms
コード長 234 bytes
コンパイル時間 3,573 ms
コンパイル使用メモリ 161,336 KB
実行使用メモリ 31,052 KB
最終ジャッジ日時 2023-08-15 21:28:05
合計ジャッジ時間 7,203 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
22,764 KB
testcase_01 AC 71 ms
20,856 KB
testcase_02 AC 72 ms
24,800 KB
testcase_03 AC 70 ms
24,904 KB
testcase_04 AC 70 ms
24,744 KB
testcase_05 AC 71 ms
22,772 KB
testcase_06 AC 71 ms
22,860 KB
testcase_07 AC 76 ms
20,740 KB
testcase_08 AC 96 ms
24,904 KB
testcase_09 AC 118 ms
28,864 KB
testcase_10 AC 194 ms
29,024 KB
testcase_11 AC 198 ms
26,988 KB
testcase_12 AC 204 ms
31,052 KB
testcase_13 AC 209 ms
30,960 KB
testcase_14 AC 203 ms
26,928 KB
testcase_15 AC 205 ms
30,976 KB
testcase_16 AC 217 ms
26,872 KB
testcase_17 AC 72 ms
20,656 KB
testcase_18 AC 76 ms
22,692 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: int64) =
  let rec loop (N: int64) (ans: int64) =
    if N <= (int64 0) then ans
    else loop (N-1L) (ans + (Console.ReadLine() |> int64))
  loop N 0L

let N = Console.ReadLine() |> int64
printfn "%d" (sum N)
0