結果

問題 No.289 数字を全て足そう
ユーザー chike_pluschike_plus
提出日時 2019-03-19 12:24:38
言語 F#
(F# 4.0)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 284 bytes
コンパイル時間 3,220 ms
コンパイル使用メモリ 163,580 KB
実行使用メモリ 36,100 KB
最終ジャッジ日時 2023-10-11 21:04:30
合計ジャッジ時間 6,918 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
27,932 KB
testcase_01 AC 104 ms
27,824 KB
testcase_02 AC 103 ms
25,832 KB
testcase_03 AC 95 ms
25,396 KB
testcase_04 AC 104 ms
25,828 KB
testcase_05 AC 106 ms
27,968 KB
testcase_06 AC 105 ms
27,944 KB
testcase_07 AC 107 ms
25,884 KB
testcase_08 AC 107 ms
25,888 KB
testcase_09 AC 105 ms
23,896 KB
testcase_10 AC 106 ms
26,056 KB
testcase_11 AC 107 ms
27,928 KB
testcase_12 AC 108 ms
26,008 KB
testcase_13 AC 107 ms
27,968 KB
testcase_14 AC 108 ms
28,068 KB
testcase_15 AC 107 ms
25,908 KB
testcase_16 AC 106 ms
25,908 KB
testcase_17 AC 107 ms
28,000 KB
testcase_18 AC 108 ms
26,104 KB
testcase_19 AC 106 ms
25,976 KB
testcase_20 AC 107 ms
25,888 KB
testcase_21 AC 104 ms
25,956 KB
testcase_22 AC 108 ms
25,912 KB
testcase_23 AC 125 ms
36,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
open System.Text.RegularExpressions

let S = Console.ReadLine()

let reg = Regex("(\d)")

match reg.IsMatch(S) with
| false -> 0
| true  -> 
    let mutable sum = 0
    for m in reg.Matches(S) do
      sum <- sum + (m.Groups.[1].Value |> int)

    sum
|> Console.WriteLine
0