結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー 👑 p-adicp-adic
提出日時 2023-07-26 08:48:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 501 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 24,112 KB
最終ジャッジ日時 2024-02-23 20:50:46
合計ジャッジ時間 7,673 ms
ジャッジサーバーID
(参考情報)
judge11 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,112 KB
testcase_01 AC 28 ms
9,984 KB
testcase_02 AC 2,140 ms
24,112 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

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