結果
問題 | No.129 お年玉(2) |
ユーザー |
![]() |
提出日時 | 2016-03-23 00:59:09 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 203 ms / 5,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 742 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 53,504 KB |
最終ジャッジ日時 | 2024-11-28 00:23:52 |
合計ジャッジ時間 | 8,113 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 46 |
コンパイルメッセージ
Syntax OK
ソースコード
class Integerdef combination(k)self.factorial/(k.factorial*(self-k).factorial)enddef permutation(k)self.factorial/(self-k).factorialenddef factorialreturn 1 if self == 0(1..self).inject(:*)endendclass YukicoderMOD = 1000000000def initializen = gets.to_im = gets.to_iputs m.combination((n-m*1000*(n/m/1000))/1000) % MODendendYukicoder.new