結果

問題 No.129 お年玉(2)
ユーザー koyumeishikoyumeishi
提出日時 2015-01-17 00:16:22
言語 Ruby
(3.2.1 )
結果
AC  
実行時間 366 ms / 5,000 ms
コード長 180 bytes
コンパイル時間 182 ms
実行使用メモリ 41,024 KB
最終ジャッジ日時 2023-01-04 19:15:13
合計ジャッジ時間 8,680 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
14,176 KB
testcase_01 AC 366 ms
41,024 KB
testcase_02 AC 72 ms
13,868 KB
testcase_03 AC 72 ms
13,772 KB
testcase_04 AC 72 ms
13,728 KB
testcase_05 AC 166 ms
27,556 KB
testcase_06 AC 120 ms
21,980 KB
testcase_07 AC 186 ms
29,752 KB
testcase_08 AC 211 ms
31,376 KB
testcase_09 AC 107 ms
20,572 KB
testcase_10 AC 212 ms
31,164 KB
testcase_11 AC 134 ms
23,596 KB
testcase_12 AC 76 ms
14,040 KB
testcase_13 AC 74 ms
14,188 KB
testcase_14 AC 122 ms
21,836 KB
testcase_15 AC 116 ms
21,168 KB
testcase_16 AC 140 ms
23,948 KB
testcase_17 AC 99 ms
19,188 KB
testcase_18 AC 194 ms
30,288 KB
testcase_19 AC 262 ms
35,160 KB
testcase_20 AC 159 ms
25,940 KB
testcase_21 AC 106 ms
19,836 KB
testcase_22 AC 149 ms
25,304 KB
testcase_23 AC 204 ms
30,636 KB
testcase_24 AC 296 ms
37,300 KB
testcase_25 AC 131 ms
22,588 KB
testcase_26 AC 175 ms
28,500 KB
testcase_27 AC 165 ms
27,264 KB
testcase_28 AC 148 ms
25,016 KB
testcase_29 AC 73 ms
13,820 KB
testcase_30 AC 73 ms
13,688 KB
testcase_31 AC 71 ms
13,688 KB
testcase_32 AC 69 ms
13,848 KB
testcase_33 AC 71 ms
13,928 KB
testcase_34 AC 71 ms
13,844 KB
testcase_35 AC 71 ms
13,772 KB
testcase_36 AC 72 ms
13,824 KB
testcase_37 AC 72 ms
13,820 KB
testcase_38 AC 81 ms
15,920 KB
testcase_39 AC 77 ms
15,352 KB
testcase_40 AC 94 ms
17,760 KB
testcase_41 AC 117 ms
21,084 KB
testcase_42 AC 95 ms
18,148 KB
testcase_43 AC 73 ms
14,096 KB
testcase_44 AC 307 ms
37,524 KB
testcase_45 AC 86 ms
16,568 KB
testcase_46 AC 76 ms
14,064 KB
testcase_47 AC 257 ms
34,176 KB
testcase_48 AC 217 ms
31,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

MOD = 1000000000

n = gets.to_i
m = gets.to_i

n -= ((n/m)/1000) * 1000 * m

n /= 1000


ans = 1
for i in 0...n do
	ans *= m-i
end

for i in 0...n do
	ans /= n-i
end

puts ans%MOD
0