結果

問題 No.129 お年玉(2)
ユーザー koyumeishikoyumeishi
提出日時 2015-01-17 00:16:22
言語 Ruby
(3.3.0)
結果
AC  
実行時間 365 ms / 5,000 ms
コード長 180 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 66,684 KB
最終ジャッジ日時 2023-08-18 16:27:34
合計ジャッジ時間 8,731 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
15,648 KB
testcase_01 AC 365 ms
66,684 KB
testcase_02 AC 72 ms
15,144 KB
testcase_03 AC 74 ms
15,208 KB
testcase_04 AC 75 ms
15,204 KB
testcase_05 AC 168 ms
37,752 KB
testcase_06 AC 123 ms
31,488 KB
testcase_07 AC 192 ms
41,184 KB
testcase_08 AC 213 ms
46,524 KB
testcase_09 AC 113 ms
28,204 KB
testcase_10 AC 212 ms
45,996 KB
testcase_11 AC 140 ms
32,428 KB
testcase_12 AC 73 ms
15,572 KB
testcase_13 AC 75 ms
15,128 KB
testcase_14 AC 123 ms
31,528 KB
testcase_15 AC 115 ms
30,044 KB
testcase_16 AC 148 ms
33,304 KB
testcase_17 AC 101 ms
24,648 KB
testcase_18 AC 197 ms
41,828 KB
testcase_19 AC 268 ms
55,532 KB
testcase_20 AC 165 ms
35,756 KB
testcase_21 AC 108 ms
27,052 KB
testcase_22 AC 154 ms
35,372 KB
testcase_23 AC 205 ms
44,756 KB
testcase_24 AC 299 ms
60,392 KB
testcase_25 AC 130 ms
31,984 KB
testcase_26 AC 176 ms
38,788 KB
testcase_27 AC 168 ms
37,384 KB
testcase_28 AC 152 ms
34,832 KB
testcase_29 AC 77 ms
15,264 KB
testcase_30 AC 76 ms
15,196 KB
testcase_31 AC 73 ms
15,172 KB
testcase_32 AC 76 ms
15,284 KB
testcase_33 AC 72 ms
15,136 KB
testcase_34 AC 73 ms
15,088 KB
testcase_35 AC 74 ms
15,264 KB
testcase_36 AC 76 ms
15,116 KB
testcase_37 AC 75 ms
15,288 KB
testcase_38 AC 83 ms
17,724 KB
testcase_39 AC 80 ms
16,892 KB
testcase_40 AC 95 ms
21,236 KB
testcase_41 AC 117 ms
29,612 KB
testcase_42 AC 93 ms
22,060 KB
testcase_43 AC 75 ms
15,388 KB
testcase_44 AC 307 ms
61,496 KB
testcase_45 AC 85 ms
18,372 KB
testcase_46 AC 75 ms
15,532 KB
testcase_47 AC 255 ms
54,260 KB
testcase_48 AC 208 ms
46,940 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