結果

問題 No.1703 Much Matching
ユーザー mink1618033mink1618033
提出日時 2021-10-09 19:27:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 502 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 166,888 KB
最終ジャッジ日時 2023-10-11 08:00:21
合計ジャッジ時間 25,235 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
78,532 KB
testcase_01 AC 67 ms
71,292 KB
testcase_02 AC 67 ms
71,444 KB
testcase_03 AC 69 ms
71,568 KB
testcase_04 AC 76 ms
75,432 KB
testcase_05 AC 74 ms
75,384 KB
testcase_06 AC 1,129 ms
125,196 KB
testcase_07 AC 124 ms
79,868 KB
testcase_08 AC 1,191 ms
127,124 KB
testcase_09 AC 1,399 ms
134,996 KB
testcase_10 AC 234 ms
85,428 KB
testcase_11 AC 319 ms
89,272 KB
testcase_12 AC 120 ms
79,212 KB
testcase_13 AC 525 ms
99,716 KB
testcase_14 AC 104 ms
78,144 KB
testcase_15 AC 265 ms
86,688 KB
testcase_16 AC 737 ms
108,304 KB
testcase_17 AC 844 ms
113,376 KB
testcase_18 AC 99 ms
77,812 KB
testcase_19 AC 1,873 ms
152,596 KB
testcase_20 AC 252 ms
86,856 KB
testcase_21 TLE -
testcase_22 AC 810 ms
111,856 KB
testcase_23 AC 621 ms
103,200 KB
testcase_24 AC 98 ms
77,712 KB
testcase_25 AC 140 ms
80,524 KB
testcase_26 AC 406 ms
94,212 KB
testcase_27 AC 895 ms
116,276 KB
testcase_28 AC 1,774 ms
149,768 KB
testcase_29 AC 337 ms
90,828 KB
testcase_30 AC 489 ms
97,580 KB
testcase_31 AC 114 ms
79,188 KB
testcase_32 AC 909 ms
116,468 KB
testcase_33 AC 604 ms
102,416 KB
testcase_34 AC 126 ms
79,292 KB
testcase_35 AC 204 ms
83,872 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
import bisect

n,m,q = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(q)]

ab.sort(key=lambda x:(x[0],-x[1]))

def LIS(lst,weakly=False,max_value=float('inf')):
    f=bisect.bisect_right if weakly else bisect.bisect_left
    dp=[max_value]*(min(n,m)+1)
    for x in lst:
        i=f(dp,x)
        dp[i]=x
    res=bisect.bisect_left(dp,max_value)
    return res

inf=1<<30
bl = [b for a,b in ab]
ans=LIS(bl,max_value=10**18)
print(ans)
0