結果
| 問題 | 
                            No.129 お年玉(2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-04-17 18:47:30 | 
| 言語 | Haskell  (9.10.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 18 ms / 5,000 ms | 
| コード長 | 262 bytes | 
| コンパイル時間 | 2,118 ms | 
| コンパイル使用メモリ | 175,744 KB | 
| 実行使用メモリ | 15,104 KB | 
| 最終ジャッジ日時 | 2024-11-28 00:25:07 | 
| 合計ジャッジ時間 | 3,661 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 46 | 
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
Main.hs:5:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in two further locations.
    Suggested fix: Please use spaces instead.
  |
5 |         [n, m] <- getContents >>= return . map read . lines
  | ^^^^^^^^
[2 of 2] Linking a.out
            
            ソースコード
combination :: Integer -> Integer -> Integer combination n k = (product [n-k+1..n]) `div` (product [1..k]) main = do [n, m] <- getContents >>= return . map read . lines let k = n `mod` (m * 1000) `div` 1000 print $ combination m (minimum[k,m-k]) `mod` (10^9)