結果

問題 No.2798 Multiple Chain
ユーザー 👑 p-adicp-adic
提出日時 2024-07-07 20:10:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 767 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 76,032 KB
最終ジャッジ日時 2024-07-07 20:10:46
合計ジャッジ時間 6,083 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
57,344 KB
testcase_01 AC 127 ms
75,520 KB
testcase_02 AC 45 ms
58,112 KB
testcase_03 AC 38 ms
51,840 KB
testcase_04 AC 39 ms
51,968 KB
testcase_05 AC 55 ms
63,872 KB
testcase_06 AC 49 ms
60,544 KB
testcase_07 AC 43 ms
52,352 KB
testcase_08 AC 44 ms
58,240 KB
testcase_09 AC 49 ms
60,160 KB
testcase_10 AC 52 ms
61,824 KB
testcase_11 AC 53 ms
62,848 KB
testcase_12 AC 45 ms
58,624 KB
testcase_13 AC 61 ms
65,792 KB
testcase_14 AC 57 ms
64,768 KB
testcase_15 AC 44 ms
58,496 KB
testcase_16 AC 44 ms
58,496 KB
testcase_17 AC 49 ms
57,984 KB
testcase_18 AC 47 ms
58,368 KB
testcase_19 AC 48 ms
59,776 KB
testcase_20 AC 116 ms
75,904 KB
testcase_21 AC 113 ms
76,032 KB
testcase_22 AC 130 ms
75,776 KB
testcase_23 AC 131 ms
75,648 KB
testcase_24 AC 126 ms
75,648 KB
testcase_25 AC 46 ms
58,496 KB
testcase_26 AC 44 ms
57,856 KB
testcase_27 AC 45 ms
58,368 KB
testcase_28 AC 47 ms
60,160 KB
testcase_29 AC 44 ms
58,112 KB
testcase_30 TLE -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

R=range
n=int(input())
P,t=set(),n
for i in R(2,min(n+1,31623)):
	if t%i<1:P.add(i)
	while t%i<1:t//=i
D=[t]*(t>1)
def G(a,b):
	while a:a,b=b%a,a
	return b
def r(t):
	for j in R(len(D)):
		while D[j]%t<1:D[j]//=t
	P.add(t)
while D:
	t=D.pop()
	c=int(t**0.25)
	if t<10**9:r(t)
	else:
		while c:
			x,d=c,1
			y=(x*x+1)%t
			while (d<2)*c:x,y,d,c=(x*x+1)%t,(y**4+2*y*y+2)%t,G(abs(x-y),t),c-1
			if d<t and c:D+=[t//d,d];break
		else:r(t)
P=list(P)
L=1
C=0
for i in R(len(P)):
	p,c=P[i],0
	while n%p<1:n//=p;c+=1
	P[i]=[p,c]
	L+=c
	C=max(c,C)
D=[[s<1]*(s+1)for s in R(C+1)]
for l in R(L):
	t=[[0]for s in R(C+1)]
	for s in R(C+1):
		for d in R(s+1):t[s]+=[t[s][-1]+D[s][d]]
	D=[[t[s-d][min(s-d,d)+1]for d in R(s+1)]for s in R(C+1)]
a=1
for[p,c]in P:a*=t[c][c+1]
print(a)
0