結果

問題 No.432 占い(Easy)
ユーザー Michae'Gon
提出日時 2017-02-21 00:04:37
言語 F#
(F# 4.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 20,692 ms
コンパイル使用メモリ 187,564 KB
実行使用メモリ 52,992 KB
最終ジャッジ日時 2024-12-30 11:45:05
合計ジャッジ時間 21,561 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (910 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

module Main
open System
let t = Console.ReadLine() |> int
let ss =
    [for _ in 1..t ->
        [for c in Console.ReadLine() -> String.Concat([c]) |> int]
    ]


let rec calc = function
    | (x :: y :: zs) ->
        let xy = x + y
        let r = xy / 10
        let m = xy % 10
        let n =
            if r > 0 then
                r + m
            else
                m
        n :: calc (y :: zs)
    | _ -> []

let rec solve = function
    | [x] -> x
    | xs -> solve <| calc xs

for s in ss do
    Console.WriteLine(solve s)
0