結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2019-06-29 06:00:40 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 116 ms / 2,000 ms |
| コード長 | 931 bytes |
| 記録 | |
| コンパイル時間 | 4,919 ms |
| コンパイル使用メモリ | 200,480 KB |
| 実行使用メモリ | 59,776 KB |
| 最終ジャッジ日時 | 2026-03-23 09:22:24 |
| 合計ジャッジ時間 | 7,064 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (163 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
module Yuki
open System
let solve ss =
let inline str2Lis (str : string) =
str.ToCharArray()
|> Array.map (string >> int)
|> Array.toList
let inline num2Lis n =
let rec f acc x =
if x >= 10 then
f ((x % 10) :: acc ) (x / 10)
else
x :: acc
f [] n
let horoscope (str : string) =
let rec f =
function
| [] -> failwith ""
| x :: [] -> x
| xs ->
let ns =
xs
|> List.pairwise
|> List.map ((fun (a, b) -> a + b) >> num2Lis >> List.sum)
f ns
let ns = str2Lis str
f ns
ss
|> List.map horoscope
let T = Console.ReadLine() |> int
let S = List.init T (fun _ -> Console.ReadLine())
solve S
|> List.iter Console.WriteLine
tak