結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー 👑 p-adicp-adic
提出日時 2023-07-25 18:54:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 770 ms / 2,500 ms
コード長 501 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 177,860 KB
最終ジャッジ日時 2024-02-23 20:50:55
合計ジャッジ時間 18,920 ms
ジャッジサーバーID
(参考情報)
judge16 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 191 ms
105,228 KB
testcase_03 AC 185 ms
90,380 KB
testcase_04 AC 634 ms
167,132 KB
testcase_05 AC 475 ms
142,612 KB
testcase_06 AC 276 ms
108,708 KB
testcase_07 AC 534 ms
149,484 KB
testcase_08 AC 220 ms
101,264 KB
testcase_09 AC 723 ms
165,680 KB
testcase_10 AC 750 ms
159,016 KB
testcase_11 AC 770 ms
160,812 KB
testcase_12 AC 752 ms
160,940 KB
testcase_13 AC 767 ms
161,472 KB
testcase_14 AC 721 ms
161,440 KB
testcase_15 AC 766 ms
163,876 KB
testcase_16 AC 514 ms
160,780 KB
testcase_17 AC 529 ms
177,860 KB
testcase_18 AC 509 ms
161,592 KB
testcase_19 AC 519 ms
161,464 KB
testcase_20 AC 515 ms
160,796 KB
testcase_21 AC 521 ms
159,012 KB
testcase_22 AC 504 ms
161,472 KB
testcase_23 AC 476 ms
165,056 KB
testcase_24 AC 469 ms
162,464 KB
testcase_25 AC 469 ms
165,288 KB
testcase_26 AC 470 ms
162,884 KB
testcase_27 AC 472 ms
162,624 KB
testcase_28 AC 467 ms
165,164 KB
testcase_29 AC 462 ms
165,172 KB
testcase_30 AC 471 ms
160,936 KB
testcase_31 AC 736 ms
158,628 KB
testcase_32 AC 219 ms
114,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
def J():
	return map(int,I().split())
N,A=J()
X=list(J())
T=R(int(I()))
W=[list(J())for t in T]
Y=set(X)
for w in W:Y.add(w[0]),Y.add(w[1])
s=0
Z={}
for y in sorted(Y):Z[y],s=s,s+1
X=[Z[x]for x in X]
W=[[Z[x]for x in w]for w in W]
M=548
A=[-1]*s
B=[-1]*M
for t in T:
	l,r=W[t][0],W[t][1]+1
	m=(l+M-1)//M
	n=max(m,r//M)
	a=min(m*M,r)
	for i in R(l,a):A[i]=max(A[i],t+1)
	for i in R(m,n):B[i]=max(B[i],t+1)
	for i in R(max(a,n*M),r):A[i]=max(A[i],t+1)
for x in X:print(max(A[x],B[x//M]))
0