結果

問題 No.129 お年玉(2)
ユーザー tottoripapertottoripaper
提出日時 2015-02-22 01:39:47
言語 Haskell
(9.8.2)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 8,945 ms
コンパイル使用メモリ 164,844 KB
実行使用メモリ 18,100 KB
最終ジャッジ日時 2023-08-18 17:03:58
合計ジャッジ時間 9,174 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
11,652 KB
testcase_01 AC 32 ms
17,960 KB
testcase_02 AC 2 ms
6,972 KB
testcase_03 AC 2 ms
7,000 KB
testcase_04 AC 3 ms
7,064 KB
testcase_05 AC 23 ms
18,048 KB
testcase_06 AC 22 ms
18,064 KB
testcase_07 AC 32 ms
17,964 KB
testcase_08 AC 23 ms
18,016 KB
testcase_09 AC 22 ms
18,008 KB
testcase_10 AC 33 ms
17,948 KB
testcase_11 AC 22 ms
18,012 KB
testcase_12 AC 33 ms
18,096 KB
testcase_13 AC 33 ms
18,100 KB
testcase_14 AC 32 ms
17,976 KB
testcase_15 AC 22 ms
17,976 KB
testcase_16 AC 22 ms
17,696 KB
testcase_17 AC 32 ms
17,972 KB
testcase_18 AC 32 ms
17,928 KB
testcase_19 AC 33 ms
18,028 KB
testcase_20 AC 32 ms
17,944 KB
testcase_21 AC 32 ms
17,936 KB
testcase_22 AC 23 ms
18,020 KB
testcase_23 AC 32 ms
17,960 KB
testcase_24 AC 33 ms
18,000 KB
testcase_25 AC 22 ms
17,164 KB
testcase_26 AC 22 ms
17,980 KB
testcase_27 AC 22 ms
18,004 KB
testcase_28 AC 33 ms
17,956 KB
testcase_29 AC 2 ms
7,008 KB
testcase_30 AC 3 ms
6,992 KB
testcase_31 AC 3 ms
7,272 KB
testcase_32 AC 3 ms
7,244 KB
testcase_33 AC 3 ms
7,924 KB
testcase_34 AC 3 ms
7,540 KB
testcase_35 AC 3 ms
7,916 KB
testcase_36 AC 3 ms
7,848 KB
testcase_37 AC 3 ms
8,232 KB
testcase_38 AC 12 ms
14,436 KB
testcase_39 AC 22 ms
16,872 KB
testcase_40 AC 22 ms
18,008 KB
testcase_41 AC 22 ms
16,820 KB
testcase_42 AC 12 ms
15,436 KB
testcase_43 AC 12 ms
15,344 KB
testcase_44 AC 32 ms
18,000 KB
testcase_45 AC 7 ms
11,492 KB
testcase_46 AC 23 ms
17,356 KB
testcase_47 AC 32 ms
18,036 KB
testcase_48 AC 22 ms
18,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

-- ナニソレイミワカンナイ

import Control.Monad

mo = 1000000000

nCr :: Integer -> Integer -> Integer
nCr n k
    | n < k = 1
    | otherwise = product [1..n] `div` product [1..k] `div` product [1..(n-k)]
        
main = do
  n <- readLn
  m <- readLn
  let
      n' = n `mod` (1000 * m) `div` 1000
   in print (nCr m n' `mod` mo)
0