結果

問題 No.2896 Monotonic Prime Factors
ユーザー ねしんねしん
提出日時 2024-09-20 22:09:33
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 501 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,780 KB
実行使用メモリ 240,192 KB
最終ジャッジ日時 2024-09-20 22:10:25
合計ジャッジ時間 46,571 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,852 ms
240,052 KB
testcase_01 AC 1,870 ms
238,608 KB
testcase_02 AC 1,847 ms
239,420 KB
testcase_03 AC 1,856 ms
239,080 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 AC 1,968 ms
239,504 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 1,930 ms
239,224 KB
testcase_16 TLE -
testcase_17 AC 1,980 ms
240,192 KB
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())
fact=[1,1]
invfact=[1,1]
MOD=998244353
for i in range(2,17*10**5+1):
	fact.append((fact[-1]*i)%MOD)
	invfact.append((invfact[-1]*pow(i,MOD-2,MOD))%MOD)
def factrize(A):
	c=0
	M=A
	for i in range(2,int(A**0.5)+3):
		if  M<i:
			break
		while M%i==0:
			M=M//i
			c+=1
	if M!=1:
		c+=1
	return c
def C(n,r):
	return (fact[n]*invfact[r]*invfact[n-r])%MOD
cnt=0
for i in range(Q):
	a,b=list(map(int,input().split()))
	cnt+=factrize(a)
	if cnt<b:
		print(0)
		continue
	print(C(cnt-1,cnt-b))
0