結果

問題 No.2220 Range Insert & Point Mex
ユーザー titiatitia
提出日時 2023-02-18 01:04:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 555 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 44,184 KB
最終ジャッジ日時 2023-09-28 18:18:38
合計ジャッジ時間 17,401 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,828 KB
testcase_01 AC 17 ms
8,792 KB
testcase_02 AC 18 ms
8,836 KB
testcase_03 AC 18 ms
8,804 KB
testcase_04 AC 18 ms
8,812 KB
testcase_05 AC 18 ms
8,720 KB
testcase_06 AC 18 ms
8,812 KB
testcase_07 AC 18 ms
8,900 KB
testcase_08 AC 18 ms
8,780 KB
testcase_09 AC 18 ms
8,936 KB
testcase_10 AC 18 ms
8,748 KB
testcase_11 AC 18 ms
8,764 KB
testcase_12 AC 18 ms
8,820 KB
testcase_13 AC 698 ms
41,596 KB
testcase_14 AC 706 ms
41,516 KB
testcase_15 AC 706 ms
41,632 KB
testcase_16 AC 699 ms
41,148 KB
testcase_17 AC 702 ms
41,620 KB
testcase_18 AC 704 ms
41,672 KB
testcase_19 AC 702 ms
41,588 KB
testcase_20 AC 279 ms
20,300 KB
testcase_21 AC 278 ms
20,128 KB
testcase_22 AC 278 ms
20,296 KB
testcase_23 AC 461 ms
44,184 KB
testcase_24 AC 391 ms
38,252 KB
testcase_25 AC 310 ms
32,508 KB
testcase_26 AC 442 ms
40,364 KB
testcase_27 AC 309 ms
29,296 KB
testcase_28 AC 151 ms
20,824 KB
testcase_29 AC 153 ms
20,128 KB
testcase_30 AC 154 ms
20,212 KB
testcase_31 AC 406 ms
37,300 KB
testcase_32 AC 350 ms
33,288 KB
testcase_33 AC 350 ms
33,312 KB
testcase_34 AC 557 ms
33,536 KB
testcase_35 AC 555 ms
33,904 KB
testcase_36 AC 551 ms
33,700 KB
testcase_37 AC 556 ms
33,632 KB
testcase_38 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
Queries=[]

for i in range(N):
    l,r,a=map(int,input().split())

    if a>10**5+4:
        continue

    Queries.append((l,a,1))
    Queries.append((r+1,a,0))

Q=int(input())
X=list(map(int,input().split()))

for x in X:
    Queries.append((x,1<<60,1<<60))

Queries.sort()

NOW=0
C=[0]*(10**5+5)

for x,a,c in Queries:
    if c==1:
        C[a]+=1
        while C[NOW]!=0:
            NOW+=1
    elif c==0:
        C[a]-=1
        if C[a]==0 and a<NOW:
            NOW=a
    else:
        print(NOW)
0