結果
問題 | No.420 mod2漸化式 |
ユーザー |
|
提出日時 | 2018-08-19 13:33:38 |
言語 | Haskell (9.10.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 283 bytes |
コンパイル時間 | 2,083 ms |
コンパイル使用メモリ | 175,104 KB |
実行使用メモリ | 664,064 KB |
最終ジャッジ日時 | 2024-11-17 03:12:24 |
合計ジャッジ時間 | 5,919 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 34 MLE * 1 |
コンパイルメッセージ
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
ソースコード
import Control.Applicative main :: IO () main = solve <$> readLn >>= putStrLn solve :: Int -> String solve x = unwords . map show $ [comb 31 x, comb 30 (x-1) * 2147483647] comb n m | m == 0 = 1 | n > 2*m = comb n (n-m) | otherwise = comb (n-1) (m-1) * n `div` m