結果
| 問題 | No.502 階乗を計算するだけ |
| コンテスト | |
| ユーザー |
かりあげクン
|
| 提出日時 | 2020-09-07 17:35:17 |
| 言語 | Haskell (9.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 6,515 ms |
| コンパイル使用メモリ | 195,712 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2026-05-23 06:59:45 |
| 合計ジャッジ時間 | 10,551 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 TLE * 1 -- * 19 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.List (foldl') import Data.Bool (bool) main :: IO () main = do n <- readLn :: IO Integer print $ bool 0 (facMod 1000000007 n) (n < 1000000007) facMod :: Integer -> Integer -> Integer facMod n x = foldl' (prodMod n) 1 [1..x] prodMod :: Integer -> Integer -> Integer -> Integer prodMod n x y = ((x `mod` n) * (y `mod` n)) `mod` n
かりあげクン