結果

問題 No.1703 Much Matching
ユーザー vwxyzvwxyz
提出日時 2021-10-08 22:27:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 559 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 136,784 KB
最終ジャッジ日時 2023-09-30 10:59:15
合計ジャッジ時間 21,823 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,004 KB
testcase_01 AC 17 ms
7,940 KB
testcase_02 AC 16 ms
7,932 KB
testcase_03 AC 17 ms
8,016 KB
testcase_04 AC 18 ms
7,928 KB
testcase_05 AC 17 ms
7,908 KB
testcase_06 AC 1,018 ms
71,680 KB
testcase_07 AC 52 ms
11,172 KB
testcase_08 AC 1,116 ms
78,960 KB
testcase_09 AC 1,291 ms
88,652 KB
testcase_10 AC 139 ms
17,576 KB
testcase_11 AC 230 ms
23,968 KB
testcase_12 AC 46 ms
10,632 KB
testcase_13 AC 438 ms
37,228 KB
testcase_14 AC 25 ms
8,976 KB
testcase_15 AC 186 ms
21,464 KB
testcase_16 AC 630 ms
47,292 KB
testcase_17 AC 747 ms
52,940 KB
testcase_18 AC 24 ms
8,752 KB
testcase_19 AC 1,778 ms
115,184 KB
testcase_20 AC 166 ms
19,552 KB
testcase_21 TLE -
testcase_22 AC 717 ms
56,384 KB
testcase_23 AC 541 ms
41,996 KB
testcase_24 AC 22 ms
8,652 KB
testcase_25 AC 60 ms
11,944 KB
testcase_26 AC 322 ms
30,964 KB
testcase_27 AC 833 ms
57,028 KB
testcase_28 AC 1,656 ms
114,008 KB
testcase_29 AC 248 ms
25,496 KB
testcase_30 AC 389 ms
35,420 KB
testcase_31 AC 39 ms
10,212 KB
testcase_32 AC 808 ms
61,908 KB
testcase_33 AC 516 ms
43,952 KB
testcase_34 AC 47 ms
10,500 KB
testcase_35 AC 117 ms
15,836 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