結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー Ekiben542Ekiben542
提出日時 2024-03-03 21:53:44
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 566 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 302,616 KB
最終ジャッジ日時 2024-03-03 21:53:52
合計ジャッジ時間 7,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 TLE -
testcase_03 -- -
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 #

import bisect

N, A = map(int, input().split())
X = sorted(list(map(int, input().split())))
T = int(input())
LR = [list(map(int, input().split())) for _ in range(T)]

last_heard = {i: -1 for i in range(N)}

# bisect_leftとbisect_right関数を一度だけ呼び出す
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right

for t in range(T):
    L, R = LR[t]
    start = bisect_left(X, L)
    end = bisect_right(X, R)
    indices = set(range(start, end))
    for i in indices:
        last_heard[i] = t+1

for i in range(N):
    print(last_heard[i])

0