結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー 👑 p-adicp-adic
提出日時 2023-07-26 11:38:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 670 ms / 2,500 ms
コード長 471 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 177,864 KB
最終ジャッジ日時 2024-02-23 20:51:14
合計ジャッジ時間 17,147 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 184 ms
105,240 KB
testcase_03 AC 180 ms
90,380 KB
testcase_04 AC 591 ms
167,136 KB
testcase_05 AC 431 ms
142,612 KB
testcase_06 AC 266 ms
108,840 KB
testcase_07 AC 467 ms
149,484 KB
testcase_08 AC 195 ms
101,268 KB
testcase_09 AC 665 ms
165,680 KB
testcase_10 AC 656 ms
160,828 KB
testcase_11 AC 659 ms
160,816 KB
testcase_12 AC 667 ms
160,944 KB
testcase_13 AC 669 ms
159,520 KB
testcase_14 AC 670 ms
159,524 KB
testcase_15 AC 662 ms
163,876 KB
testcase_16 AC 491 ms
162,988 KB
testcase_17 AC 483 ms
177,864 KB
testcase_18 AC 454 ms
161,588 KB
testcase_19 AC 462 ms
161,468 KB
testcase_20 AC 469 ms
160,916 KB
testcase_21 AC 467 ms
159,012 KB
testcase_22 AC 474 ms
161,468 KB
testcase_23 AC 439 ms
165,052 KB
testcase_24 AC 434 ms
162,468 KB
testcase_25 AC 434 ms
165,288 KB
testcase_26 AC 437 ms
162,888 KB
testcase_27 AC 429 ms
162,752 KB
testcase_28 AC 430 ms
165,172 KB
testcase_29 AC 422 ms
165,168 KB
testcase_30 AC 438 ms
163,004 KB
testcase_31 AC 660 ms
160,572 KB
testcase_32 AC 204 ms
114,520 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]=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