結果

問題 No.129 お年玉(2)
ユーザー char134217728char134217728
提出日時 2017-09-07 20:38:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 159 ms / 5,000 ms
コード長 160 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,552 KB
実行使用メモリ 35,176 KB
最終ジャッジ日時 2023-08-18 18:03:04
合計ジャッジ時間 6,435 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,572 KB
testcase_01 AC 72 ms
15,248 KB
testcase_02 AC 74 ms
15,148 KB
testcase_03 AC 75 ms
15,304 KB
testcase_04 AC 75 ms
15,252 KB
testcase_05 AC 83 ms
16,724 KB
testcase_06 AC 132 ms
32,056 KB
testcase_07 AC 128 ms
30,880 KB
testcase_08 AC 78 ms
15,824 KB
testcase_09 AC 114 ms
28,336 KB
testcase_10 AC 107 ms
27,772 KB
testcase_11 AC 121 ms
30,020 KB
testcase_12 AC 75 ms
15,456 KB
testcase_13 AC 73 ms
15,196 KB
testcase_14 AC 129 ms
31,896 KB
testcase_15 AC 129 ms
30,308 KB
testcase_16 AC 138 ms
32,216 KB
testcase_17 AC 102 ms
25,232 KB
testcase_18 AC 107 ms
27,124 KB
testcase_19 AC 82 ms
17,636 KB
testcase_20 AC 148 ms
33,176 KB
testcase_21 AC 109 ms
27,404 KB
testcase_22 AC 117 ms
27,488 KB
testcase_23 AC 123 ms
30,052 KB
testcase_24 AC 75 ms
15,408 KB
testcase_25 AC 127 ms
31,540 KB
testcase_26 AC 90 ms
20,464 KB
testcase_27 AC 93 ms
21,828 KB
testcase_28 AC 159 ms
35,176 KB
testcase_29 AC 79 ms
15,144 KB
testcase_30 AC 77 ms
15,148 KB
testcase_31 AC 77 ms
15,116 KB
testcase_32 AC 77 ms
15,108 KB
testcase_33 AC 75 ms
15,180 KB
testcase_34 AC 76 ms
15,060 KB
testcase_35 AC 86 ms
15,076 KB
testcase_36 AC 77 ms
15,052 KB
testcase_37 AC 75 ms
15,116 KB
testcase_38 AC 84 ms
18,012 KB
testcase_39 AC 85 ms
16,936 KB
testcase_40 AC 102 ms
21,376 KB
testcase_41 AC 100 ms
22,156 KB
testcase_42 AC 83 ms
17,156 KB
testcase_43 AC 78 ms
15,560 KB
testcase_44 AC 87 ms
18,684 KB
testcase_45 AC 85 ms
16,292 KB
testcase_46 AC 79 ms
15,296 KB
testcase_47 AC 107 ms
25,608 KB
testcase_48 AC 85 ms
16,420 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
m = gets.to_i
n = n / 1000 % m
n = [n, m-n].min
ans = 1
(m-n+1..m).each do |i|
  ans *= i
end
(1..n).each do |i|
  ans /= i
end
p ans % 1000000000
0