結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
コンテスト
ユーザー sasa8uyauya
提出日時 2024-02-23 21:55:40
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 469 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 373 ms
コンパイル使用メモリ 85,168 KB
実行使用メモリ 98,604 KB
最終ジャッジ日時 2026-04-15 16:53:43
合計ジャッジ時間 9,331 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,a=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]=(x[i],i)
x.sort()
from atcoder import lazysegtree
from bisect import bisect_left,bisect_right
st=lazysegtree.LazySegTree(
  max,
  -1,
  max,
  max,
  -1,
  [-1]*n)
t=int(input())
for i in range(t):
  l,r=map(int,input().split())
  l=bisect_left(x,(l,0))
  r=bisect_right(x,(r,n))
  st.apply(l,r,i+1)
ans=[0]*n
for i in range(n):
  y=st.get(i)
  ans[x[i][1]]=y
print(*ans,sep="\n")
0