結果

問題 No.289 数字を全て足そう
ユーザー vain0vain0
提出日時 2015-10-16 22:37:12
言語 F#
(.NET 7)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 294 bytes
コンパイル時間 5,374 ms
コンパイル使用メモリ 163,380 KB
実行使用メモリ 27,172 KB
最終ジャッジ日時 2023-07-29 13:12:50
合計ジャッジ時間 8,146 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
20,988 KB
testcase_01 AC 76 ms
22,956 KB
testcase_02 AC 73 ms
22,996 KB
testcase_03 AC 75 ms
22,832 KB
testcase_04 AC 74 ms
23,072 KB
testcase_05 AC 71 ms
23,004 KB
testcase_06 AC 72 ms
24,948 KB
testcase_07 AC 73 ms
20,864 KB
testcase_08 AC 76 ms
24,960 KB
testcase_09 AC 73 ms
25,084 KB
testcase_10 AC 74 ms
22,948 KB
testcase_11 AC 74 ms
23,016 KB
testcase_12 AC 73 ms
25,088 KB
testcase_13 AC 74 ms
24,980 KB
testcase_14 AC 75 ms
23,064 KB
testcase_15 AC 76 ms
22,920 KB
testcase_16 AC 73 ms
22,984 KB
testcase_17 AC 73 ms
27,172 KB
testcase_18 AC 73 ms
25,028 KB
testcase_19 AC 74 ms
25,040 KB
testcase_20 AC 72 ms
22,912 KB
testcase_21 AC 71 ms
25,088 KB
testcase_22 AC 81 ms
22,952 KB
testcase_23 AC 81 ms
25,044 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
open System.Collections.Generic

let solve s =
  s
  |> Seq.choose (fun c -> if Char.IsDigit c then c |> Char.GetNumericValue |> int |> Some else None)
  |> Seq.sum

[<EntryPoint>]
let main argv =
  let s = Console.ReadLine()
  printfn "%d" <| solve s

  //exit
  0
0