結果

問題 No.644 G L C C D M
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-29 09:38:30
言語 Ruby
(3.2.2)
結果
AC  
実行時間 208 ms / 2,000 ms
コード長 136 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 18,720 KB
最終ジャッジ日時 2023-07-30 08:05:08
合計ジャッジ時間 4,730 ms
ジャッジサーバーID
(参考情報)
judge13 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
14,972 KB
testcase_01 AC 82 ms
15,272 KB
testcase_02 AC 81 ms
15,080 KB
testcase_03 AC 81 ms
15,148 KB
testcase_04 AC 82 ms
15,144 KB
testcase_05 AC 81 ms
15,084 KB
testcase_06 AC 81 ms
15,108 KB
testcase_07 AC 82 ms
15,072 KB
testcase_08 AC 82 ms
15,148 KB
testcase_09 AC 82 ms
15,220 KB
testcase_10 AC 80 ms
15,192 KB
testcase_11 AC 84 ms
15,196 KB
testcase_12 AC 83 ms
15,388 KB
testcase_13 AC 91 ms
15,484 KB
testcase_14 AC 88 ms
15,344 KB
testcase_15 AC 83 ms
15,304 KB
testcase_16 AC 83 ms
15,096 KB
testcase_17 AC 84 ms
15,344 KB
testcase_18 AC 100 ms
17,668 KB
testcase_19 AC 80 ms
15,196 KB
testcase_20 AC 82 ms
15,360 KB
testcase_21 AC 81 ms
15,480 KB
testcase_22 AC 208 ms
18,720 KB
testcase_23 AC 198 ms
18,256 KB
testcase_24 AC 195 ms
17,908 KB
testcase_25 AC 102 ms
17,840 KB
testcase_26 AC 102 ms
17,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M=10**9+7
n,m=gets.split.map &:to_i
f=[*-1..n]
z=(2..n/m).map{|i|(2*i).step(n,i){|j|f[j]-=f[i]};f[i]}.sum*2
(2..n-2).map{|i|z=z*i%M}
p z
0