結果
問題 |
No.420 mod2漸化式
|
ユーザー |
|
提出日時 | 2018-08-19 13:31:19 |
言語 | Haskell (9.10.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 292 bytes |
コンパイル時間 | 9,318 ms |
コンパイル使用メモリ | 176,768 KB |
実行使用メモリ | 741,504 KB |
最終ジャッジ日時 | 2024-11-17 03:05:02 |
合計ジャッジ時間 | 13,248 ms |
ジャッジサーバーID (参考情報) |
judge1 / 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] where comb n m | m == 0 = 1 | n > 2*m = comb n (n-m) | otherwise = comb (n-1) (m-1) * n `div` m