結果

問題 No.523 LED
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-06-03 11:32:06
言語 Haskell
(9.8.2)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 294 bytes
コンパイル時間 7,221 ms
コンパイル使用メモリ 164,452 KB
実行使用メモリ 653,040 KB
最終ジャッジ日時 2023-10-22 02:51:35
合計ジャッジ時間 18,379 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,112 KB
testcase_01 AC 2 ms
5,208 KB
testcase_02 AC 22 ms
14,848 KB
testcase_03 AC 2 ms
5,112 KB
testcase_04 AC 2 ms
5,212 KB
testcase_05 MLE -
testcase_06 AC 3 ms
5,188 KB
testcase_07 AC 2 ms
5,164 KB
testcase_08 AC 2 ms
5,164 KB
testcase_09 AC 22 ms
12,736 KB
testcase_10 AC 2 ms
5,204 KB
testcase_11 AC 2 ms
5,316 KB
testcase_12 AC 2 ms
5,316 KB
testcase_13 AC 381 ms
131,960 KB
testcase_14 AC 2 ms
5,276 KB
testcase_15 AC 4 ms
6,788 KB
testcase_16 AC 2 ms
5,312 KB
testcase_17 AC 4 ms
6,952 KB
testcase_18 MLE -
testcase_19 AC 698 ms
232,312 KB
testcase_20 AC 576 ms
206,024 KB
testcase_21 AC 1,470 ms
487,288 KB
testcase_22 MLE -
testcase_23 MLE -
testcase_24 AC 32 ms
18,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Int (Int64)

modProd :: Integral a => a -> a -> a -> a
modProd m a b = a * b `mod` m

solve :: Integral a => a -> a -> a
solve m n = foldr1 (modProd m) [modProd m k (2 * k - 1) | k <- [1 .. n]]

main :: IO ()
main = do
    let m = 1000000007 :: Int64
    print . solve m =<< readLn
0