結果

問題 No.1703 Much Matching
ユーザー vwxyzvwxyz
提出日時 2021-10-08 22:27:15
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 559 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 171,196 KB
最終ジャッジ日時 2023-09-30 10:59:38
合計ジャッジ時間 22,475 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,236 KB
testcase_01 AC 73 ms
71,064 KB
testcase_02 AC 74 ms
71,152 KB
testcase_03 AC 75 ms
70,964 KB
testcase_04 AC 81 ms
75,104 KB
testcase_05 AC 77 ms
75,276 KB
testcase_06 AC 940 ms
106,784 KB
testcase_07 AC 123 ms
78,064 KB
testcase_08 AC 996 ms
107,468 KB
testcase_09 AC 1,151 ms
114,528 KB
testcase_10 AC 204 ms
81,128 KB
testcase_11 AC 275 ms
83,080 KB
testcase_12 AC 117 ms
78,172 KB
testcase_13 AC 455 ms
88,332 KB
testcase_14 AC 99 ms
77,296 KB
testcase_15 AC 241 ms
81,664 KB
testcase_16 AC 621 ms
94,224 KB
testcase_17 AC 721 ms
98,344 KB
testcase_18 AC 98 ms
76,424 KB
testcase_19 AC 1,542 ms
129,284 KB
testcase_20 AC 235 ms
81,900 KB
testcase_21 AC 1,837 ms
139,536 KB
testcase_22 AC 685 ms
97,684 KB
testcase_23 AC 523 ms
92,236 KB
testcase_24 AC 94 ms
76,624 KB
testcase_25 AC 129 ms
78,124 KB
testcase_26 AC 357 ms
86,092 KB
testcase_27 AC 782 ms
100,152 KB
testcase_28 AC 1,466 ms
123,892 KB
testcase_29 AC 291 ms
83,864 KB
testcase_30 AC 420 ms
88,136 KB
testcase_31 AC 110 ms
77,356 KB
testcase_32 AC 770 ms
99,504 KB
testcase_33 AC 505 ms
90,296 KB
testcase_34 AC 116 ms
78,220 KB
testcase_35 AC 183 ms
80,404 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import sys
readline=sys.stdin.readline

def LIS(lst,weakly=False,max_value=float('inf')):
    f=bisect.bisect_right if weakly else bisect.bisect_left
    N=len(lst)
    update=[None]*N
    dp=[max_value]*N
    for k,x in enumerate(lst):
        i=f(dp,x)
        dp[i]=x
        update[k]=(i,dp[i])
    n=bisect.bisect_left(dp,max_value)
    return n

N,M,Q=map(int,readline().split())
AB=[]
for _ in range(Q):
    a,b=map(int,readline().split())
    AB.append((a,-b))
AB.sort()
B=[-b for a,b in AB]
inf=1<<60
ans=LIS(B,max_value=inf)
print(ans)
0