結果

問題 No.432 占い(Easy)
ユーザー Michae'GonMichae'Gon
提出日時 2017-02-21 00:04:37
言語 F#
(F# 4.0)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 5,597 ms
コンパイル使用メモリ 164,796 KB
実行使用メモリ 28,572 KB
最終ジャッジ日時 2023-08-28 22:01:24
合計ジャッジ時間 9,038 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
22,208 KB
testcase_01 AC 64 ms
24,256 KB
testcase_02 AC 65 ms
24,408 KB
testcase_03 AC 63 ms
22,196 KB
testcase_04 AC 64 ms
22,368 KB
testcase_05 AC 65 ms
22,364 KB
testcase_06 AC 65 ms
24,300 KB
testcase_07 AC 63 ms
22,220 KB
testcase_08 AC 64 ms
22,320 KB
testcase_09 AC 69 ms
22,264 KB
testcase_10 AC 66 ms
22,300 KB
testcase_11 AC 68 ms
24,444 KB
testcase_12 AC 89 ms
26,520 KB
testcase_13 AC 90 ms
26,588 KB
testcase_14 AC 67 ms
24,372 KB
testcase_15 AC 65 ms
24,420 KB
testcase_16 AC 65 ms
22,400 KB
testcase_17 AC 86 ms
26,460 KB
testcase_18 AC 78 ms
26,544 KB
testcase_19 AC 73 ms
28,572 KB
testcase_20 AC 68 ms
26,424 KB
testcase_21 AC 70 ms
28,456 KB
testcase_22 AC 66 ms
24,340 KB
testcase_23 AC 67 ms
24,464 KB
testcase_24 AC 69 ms
22,288 KB
testcase_25 AC 68 ms
20,388 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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