結果

問題 No.2220 Range Insert & Point Mex
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-02-17 22:47:21
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 819 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,376 KB
実行使用メモリ 122,496 KB
最終ジャッジ日時 2023-09-28 18:11:38
合計ジャッジ時間 20,291 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
72,260 KB
testcase_01 AC 79 ms
72,236 KB
testcase_02 AC 77 ms
72,048 KB
testcase_03 AC 80 ms
72,272 KB
testcase_04 AC 81 ms
72,180 KB
testcase_05 AC 79 ms
72,100 KB
testcase_06 AC 77 ms
72,208 KB
testcase_07 AC 79 ms
72,304 KB
testcase_08 AC 78 ms
72,304 KB
testcase_09 AC 79 ms
72,256 KB
testcase_10 AC 79 ms
71,860 KB
testcase_11 AC 78 ms
72,228 KB
testcase_12 AC 78 ms
72,420 KB
testcase_13 AC 917 ms
120,812 KB
testcase_14 AC 907 ms
121,008 KB
testcase_15 AC 900 ms
121,004 KB
testcase_16 AC 902 ms
120,776 KB
testcase_17 AC 908 ms
121,016 KB
testcase_18 AC 916 ms
120,928 KB
testcase_19 AC 916 ms
121,052 KB
testcase_20 AC 249 ms
111,376 KB
testcase_21 AC 249 ms
111,400 KB
testcase_22 AC 250 ms
111,444 KB
testcase_23 AC 406 ms
120,464 KB
testcase_24 AC 396 ms
118,016 KB
testcase_25 AC 284 ms
101,440 KB
testcase_26 AC 409 ms
119,416 KB
testcase_27 AC 375 ms
112,540 KB
testcase_28 AC 120 ms
98,028 KB
testcase_29 AC 122 ms
99,444 KB
testcase_30 AC 122 ms
99,276 KB
testcase_31 AC 398 ms
118,396 KB
testcase_32 AC 346 ms
107,404 KB
testcase_33 AC 293 ms
107,216 KB
testcase_34 AC 622 ms
110,592 KB
testcase_35 AC 616 ms
111,192 KB
testcase_36 AC 618 ms
110,616 KB
testcase_37 AC 609 ms
110,632 KB
testcase_38 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
LRA = [list(map(int,input().split())) for i in range(n)]

q = int(input())
X = list(map(int,input().split()))
M = 10**5+5
event = []
for l,r,a in LRA:
    if a >= M:
        continue
    event.append([l,a,0])
    event.append([r+1,a,1])

ans = []
event.sort()
mex = [0]*(10**5+5)
now = 0
mexnum = 0
le = len(event)
for x in X:
    # print(x)
    while now < le and event[now][0] <= x:
        _,a,t = event[now]
        now += 1
        if t == 0:
            mex[a] += 1
            if mexnum == a:
                while mex[mexnum]:
                    mexnum += 1
        else:
            mex[a] -= 1
            if mex[a] == 0 and mexnum > a:
                mexnum = a
    #     print(_,a,t,mexnum)
    #     print(mex[:10])
    # print(x,mexnum)
    ans.append(mexnum)
for i in ans:
    print(i)
0