結果

問題 No.3112 区間和係数多項式?
ユーザー 👑 p-adicp-adic
提出日時 2024-02-05 19:30:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 423 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-02-05 19:30:54
合計ジャッジ時間 13,306 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,112 KB
testcase_01 AC 28 ms
10,112 KB
testcase_02 AC 28 ms
10,112 KB
testcase_03 AC 29 ms
10,112 KB
testcase_04 AC 28 ms
10,112 KB
testcase_05 AC 28 ms
10,112 KB
testcase_06 AC 29 ms
10,112 KB
testcase_07 AC 28 ms
10,112 KB
testcase_08 AC 28 ms
10,112 KB
testcase_09 AC 28 ms
10,112 KB
testcase_10 AC 29 ms
10,112 KB
testcase_11 AC 28 ms
10,112 KB
testcase_12 AC 30 ms
10,112 KB
testcase_13 AC 36 ms
10,240 KB
testcase_14 AC 51 ms
10,880 KB
testcase_15 AC 130 ms
10,880 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

R=range
J=lambda:map(int,input().split())
N,B,Q=J()
E,D=J()
A=[E]
for i in R(N-1):A+=[A[-1]*D%B]
F=[0]
for j in R(1,N):
	i=j-1
	F+=[A[j]]
	while i>j-(j&-j):
		F[j]+=F[i]
		i-=i&-i
i,r=J()
j,s=J()
x,t=J()
y,u=J()
for q in R(Q):
	k=i%N
	d=x-A[k]
	A[k]=x
	if k:
		while k<N:F[k],k=(F[k]+d)%B,k+(k&-k)
	else:E=(E+d)%B
	f=0
	p=1
	k=j%N
	while k:f,p,k=f+p*F[k],p*y%B,k-(k&-k)
	print((f+p*E)%B)
	i=i*r%N
	j=j*s%N
	x=x*t%B
	y=y*u%B
0