結果
問題 | No.500 階乗電卓 |
ユーザー | Nobita Gomu |
提出日時 | 2017-09-26 22:12:15 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 5,053 ms |
コンパイル使用メモリ | 158,376 KB |
実行使用メモリ | 25,136 KB |
最終ジャッジ日時 | 2023-09-07 08:45:10 |
合計ジャッジ時間 | 8,086 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 78 ms
20,984 KB |
testcase_01 | AC | 78 ms
22,924 KB |
testcase_02 | AC | 80 ms
25,000 KB |
testcase_03 | AC | 78 ms
20,772 KB |
testcase_04 | AC | 89 ms
23,060 KB |
testcase_05 | AC | 88 ms
23,052 KB |
testcase_06 | AC | 89 ms
25,048 KB |
testcase_07 | AC | 88 ms
23,016 KB |
testcase_08 | AC | 89 ms
23,156 KB |
testcase_09 | AC | 89 ms
25,136 KB |
testcase_10 | AC | 91 ms
23,016 KB |
testcase_11 | AC | 91 ms
23,060 KB |
testcase_12 | AC | 91 ms
23,128 KB |
testcase_13 | AC | 90 ms
23,140 KB |
testcase_14 | AC | 89 ms
23,120 KB |
testcase_15 | AC | 90 ms
23,164 KB |
testcase_16 | AC | 83 ms
22,980 KB |
testcase_17 | AC | 87 ms
25,000 KB |
testcase_18 | AC | 79 ms
22,884 KB |
testcase_19 | AC | 80 ms
22,868 KB |
testcase_20 | AC | 80 ms
22,892 KB |
testcase_21 | AC | 81 ms
22,880 KB |
testcase_22 | AC | 80 ms
23,072 KB |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
let reader (s:string) = match String.length s with | i when i > 2 -> 50 | _ -> int s let factorial n = if n >= 50 then bigint.Zero else seq { 1..n } |> Seq.map bigint |> Seq.reduce (*) let fmt (n:bigint) = if n = bigint.Zero then "000000000000" else let s = string n match String.length s with | i when i > 12 -> s.[i-12..i-1] | _ -> s let calc = reader >> factorial >> fmt stdin.ReadLine () |> calc |> printfn "%s"