結果

問題 No.2592 おでぶなおばけさん 2
ユーザー 👑 p-adicp-adic
提出日時 2023-12-21 00:45:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 665 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 93,304 KB
最終ジャッジ日時 2023-12-21 00:46:12
合計ジャッジ時間 20,586 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
63,084 KB
testcase_01 AC 211 ms
81,876 KB
testcase_02 AC 1,357 ms
81,148 KB
testcase_03 AC 444 ms
78,056 KB
testcase_04 AC 1,047 ms
78,456 KB
testcase_05 AC 611 ms
92,252 KB
testcase_06 AC 1,157 ms
81,180 KB
testcase_07 AC 1,381 ms
80,612 KB
testcase_08 AC 1,325 ms
84,856 KB
testcase_09 AC 562 ms
79,160 KB
testcase_10 AC 938 ms
78,636 KB
testcase_11 AC 1,200 ms
84,688 KB
testcase_12 AC 351 ms
78,208 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
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 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import random
import sys
B=random.randrange(30,60)
print(B,file=sys.stderr)
R=range
J=lambda:map(int,input().split())
N,Q,K=J()
A=list(J())
while N%B:
	A+=[0]
	N+=1
N//=B
def Add(i,t,F):
	i+=1
	while i<=N:F[i],i=F[i]+t,i+(i&-i)
def InitialSum(r,F):
	a=0
	i=min(r+1,N)
	while i:a,i=a+F[i],i-(i&-i)
	return a
def IntervalSum(l,r,F):
	return InitialSum(r,F)-InitialSum(l-1,F)
bit=[[0]*(N+1)for i in R(B)]
for i in R(B):
	for j in R(N):Add(j,A[j*B+i],bit[i])
for q in R(Q):
	l,r=J()
	k=K
	l,t,p,M=l-1,0,1,pow(k,B)-1
	for i in R(B):
		x,y=l//B,(r-1)//B
		if l>x*B+i:x+=1
		if y*B+i>r-1:y-=1
		t,p=t+(0if x>y else IntervalSum(x,y,bit[i])*p),p*k
	print("YNeos"[t%M==0::2])
0