結果

問題 No.1659 Product of Divisors
ユーザー yuruhiyayuruhiya
提出日時 2021-08-28 18:31:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-05-01 16:05:59
合計ジャッジ時間 9,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
12,544 KB
testcase_01 AC 97 ms
12,416 KB
testcase_02 AC 90 ms
12,032 KB
testcase_03 AC 89 ms
12,288 KB
testcase_04 AC 543 ms
12,544 KB
testcase_05 AC 363 ms
12,416 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 699 ms
12,672 KB
testcase_09 AC 699 ms
12,544 KB
testcase_10 WA -
testcase_11 AC 702 ms
12,416 KB
testcase_12 AC 686 ms
12,672 KB
testcase_13 AC 85 ms
12,288 KB
testcase_14 AC 688 ms
12,672 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 108 ms
12,544 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 596 ms
12,544 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