結果

問題 No.129 お年玉(2)
ユーザー okadukiokaduki
提出日時 2015-01-17 00:19:05
言語 Haskell
(9.6.1)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 315 bytes
コンパイル時間 1,969 ms
実行使用メモリ 15,436 KB
最終ジャッジ日時 2023-01-04 19:16:43
合計ジャッジ時間 4,330 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,152 KB
testcase_01 AC 27 ms
15,104 KB
testcase_02 AC 1 ms
4,236 KB
testcase_03 AC 2 ms
4,108 KB
testcase_04 AC 2 ms
4,112 KB
testcase_05 AC 16 ms
15,436 KB
testcase_06 AC 12 ms
14,852 KB
testcase_07 AC 16 ms
15,356 KB
testcase_08 AC 18 ms
15,144 KB
testcase_09 AC 9 ms
12,552 KB
testcase_10 AC 18 ms
15,212 KB
testcase_11 AC 14 ms
15,284 KB
testcase_12 AC 2 ms
4,712 KB
testcase_13 AC 2 ms
4,552 KB
testcase_14 AC 11 ms
13,992 KB
testcase_15 AC 11 ms
14,032 KB
testcase_16 AC 14 ms
15,140 KB
testcase_17 AC 7 ms
10,188 KB
testcase_18 AC 17 ms
15,252 KB
testcase_19 AC 20 ms
15,180 KB
testcase_20 AC 15 ms
15,216 KB
testcase_21 AC 8 ms
12,144 KB
testcase_22 AC 15 ms
14,764 KB
testcase_23 AC 18 ms
15,364 KB
testcase_24 AC 22 ms
15,272 KB
testcase_25 AC 14 ms
15,152 KB
testcase_26 AC 17 ms
15,264 KB
testcase_27 AC 15 ms
14,708 KB
testcase_28 AC 15 ms
15,272 KB
testcase_29 AC 2 ms
4,120 KB
testcase_30 AC 2 ms
4,112 KB
testcase_31 AC 2 ms
4,216 KB
testcase_32 AC 2 ms
4,284 KB
testcase_33 AC 2 ms
4,132 KB
testcase_34 AC 2 ms
4,496 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 2 ms
4,552 KB
testcase_37 AC 2 ms
4,428 KB
testcase_38 AC 5 ms
7,628 KB
testcase_39 AC 3 ms
6,736 KB
testcase_40 AC 5 ms
8,672 KB
testcase_41 AC 11 ms
13,772 KB
testcase_42 AC 6 ms
8,588 KB
testcase_43 AC 2 ms
4,764 KB
testcase_44 AC 23 ms
15,196 KB
testcase_45 AC 6 ms
8,616 KB
testcase_46 AC 2 ms
4,760 KB
testcase_47 AC 20 ms
15,148 KB
testcase_48 AC 18 ms
15,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.2.2/environments/default
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking a.out ...

ソースコード

diff #

import Control.Applicative
import Text.Printf

main = do
  n <- (read :: String -> Integer) <$> getLine
  m <- (read :: String -> Integer) <$> getLine
  print $ choose m (n `div` 1000 * 1000 `mod` (m*1000) `div` 1000)

choose n k = (f n k `div` f k k) `mod` 1000000000 
  where
    f n k = foldr (*) 1 [n-k+1..n]
  
0