結果

問題 No.420 mod2漸化式
ユーザー Ysmr_RyYsmr_Ry
提出日時 2016-11-22 21:17:50
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 285 bytes
コンパイル時間 5,713 ms
コンパイル使用メモリ 172,160 KB
実行使用メモリ 530,336 KB
最終ジャッジ日時 2024-05-05 12:22:43
合計ジャッジ時間 8,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 MLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_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

ソースコード

diff #

main :: IO ()
main = do
  x <- readLn
  putStrLn $ show (comb 31 x) ++ " " ++ show ((2^31-1)*comb 30 (x-1))

fact :: Integral a => a -> a
fact 0 = 1
fact n = n * fact (n-1)

comb :: Integral a => a -> a -> a
comb n r
  | n < r     = 0
  | otherwise = fact n `div` (fact (n-r) * fact r)
0