結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-02-23 22:49:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 125,724 KB
最終ジャッジ日時 2024-02-23 22:49:27
合計ジャッジ時間 6,531 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
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 #

n,a=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
q=[]
for i in range(n):
  q+=[(x[i],1,i)]
t=int(input())
for i in range(t):
  l,r=map(int,input().split())
  q+=[(l,0,i)]
  q+=[(r,2,i)]
q.sort()
print(q)
ans=[-1]*n
v=[0]*t
p=[]
for x,y,z in q:
  if y==0:
    p+=[z]
    v[z]=1
  if y==1:
    p.sort()
    while len(p)>0 and v[p[-1]]==0:
      p.pop()
    if len(p)>0:
      ans[z]=p[-1]+1
  if y==2:
    v[z]=0
print(*ans,sep="\n")
0