結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー 👑 p-adicp-adic
提出日時 2023-07-26 11:38:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 471 bytes
コンパイル時間 1,426 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 77,120 KB
最終ジャッジ日時 2024-02-23 20:51:02
合計ジャッジ時間 8,946 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,112 KB
testcase_01 AC 28 ms
10,112 KB
testcase_02 AC 841 ms
24,104 KB
testcase_03 AC 1,684 ms
21,528 KB
testcase_04 TLE -
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]=t+1
	for i in R(m,n):B[i]=t+1
	for i in R(max(a,n*M),r):A[i]=t+1
for x in X:print(max(A[x],B[x//M]))
0