結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2017-04-17 14:12:11 |
言語 | F# (F# 4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 455 bytes |
コンパイル時間 | 8,449 ms |
コンパイル使用メモリ | 191,944 KB |
実行使用メモリ | 68,856 KB |
最終ジャッジ日時 | 2024-07-19 05:23:11 |
合計ジャッジ時間 | 14,948 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 19 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (233 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/
ソースコード
open System let No500 () = let N = Numerics.BigInteger.Parse <| Console.ReadLine() let rec fac (n : Numerics.BigInteger) (f : Numerics.BigInteger) = if n = (Numerics.BigInteger.Parse "1") then f else fac (n - (Numerics.BigInteger.Parse "1")) (f * n) let ans = fac N (Numerics.BigInteger.Parse "1") let ans = ans % Numerics.BigInteger.Parse "1000000000000" printfn "%A" ans () No500 ()