結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2019-08-27 20:29:26 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 879 bytes |
コンパイル時間 | 10,610 ms |
コンパイル使用メモリ | 177,420 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 04:24:46 |
合計ジャッジ時間 | 11,790 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
importData.ArrayimportData.Array.IOimportControl.MonadimportControl.ApplicativeimportData.ListimportData.Charmain::IO()main = don <- readLn :: IO Inta <- combDP 31 nb <- combDP 30 (n - 1)let c = 2147483647 * bif n == 0then putStrLn "1 0"else if n > 31then putStrLn "0 0"else putStrLn $ show a ++ " " ++ show ccombDP::Int->Int->IOIntegercombDP n r| r < 0 = return 1| r > n = return 0| otherwise = doa <- newArray ( (0, 0), (n, n) ) 1 :: IO (IOArray (Int, Int) Integer)mapM_ (\x -> mapM_ (\y -> dob <- readArray a (x - 1, y)c <- readArray a (x - 1, y - 1)writeArray a (x, y) (b + c))[1 .. x - 1])[2 .. n]readArray a (n, r)