結果
問題 | No.500 階乗電卓 |
ユーザー |
|
提出日時 | 2017-09-26 22:12:15 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 12,543 ms |
コンパイル使用メモリ | 187,196 KB |
実行使用メモリ | 31,604 KB |
最終ジャッジ日時 | 2024-06-25 03:05:29 |
合計ジャッジ時間 | 15,257 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (234 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/
ソースコード
let reader (s:string) =match String.length s with| i when i > 2 -> 50| _ -> int slet factorial n =if n >= 50 thenbigint.Zeroelseseq { 1..n } |> Seq.map bigint |> Seq.reduce (*)let fmt (n:bigint) =if n = bigint.Zero then"000000000000"elselet s = string nmatch String.length s with| i when i > 12 -> s.[i-12..i-1]| _ -> slet calc = reader >> factorial >> fmtstdin.ReadLine () |> calc |> printfn "%s"