結果

問題 No.1659 Product of Divisors
ユーザー yuruhiyayuruhiya
提出日時 2021-08-28 18:31:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 614 ms
コンパイル使用メモリ 11,416 KB
実行使用メモリ 15,924 KB
最終ジャッジ日時 2023-08-14 03:13:36
合計ジャッジ時間 9,085 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,360 KB
testcase_01 AC 88 ms
15,700 KB
testcase_02 AC 79 ms
15,060 KB
testcase_03 AC 80 ms
15,640 KB
testcase_04 AC 491 ms
15,708 KB
testcase_05 AC 327 ms
15,600 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 626 ms
15,540 KB
testcase_09 AC 629 ms
15,708 KB
testcase_10 WA -
testcase_11 AC 626 ms
15,708 KB
testcase_12 AC 615 ms
15,684 KB
testcase_13 AC 79 ms
15,300 KB
testcase_14 AC 621 ms
15,812 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 97 ms
15,576 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 535 ms
15,836 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M = 10**9 + 7
n, k = gets.split.map(&:to_i)
ans = 1
(2..n**0.5).each do |p|
	c = 0
	while n % p == 0
		c += 1
		n /= p
	end
	(k + 1..k + c).each { |i| ans = ans * i % M }
	(1..c).each { |i| ans = ans * i.pow(M - 2, M) % M }
end
ans = ans * -~n % M if n > 1
puts ans
0