結果

問題 No.1703 Much Matching
ユーザー gr1msl3ygr1msl3y
提出日時 2021-10-08 22:46:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 332 bytes
コンパイル時間 1,063 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 163,004 KB
最終ジャッジ日時 2023-09-30 11:52:56
合計ジャッジ時間 27,888 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,568 KB
testcase_01 AC 75 ms
71,216 KB
testcase_02 AC 73 ms
71,124 KB
testcase_03 AC 75 ms
70,848 KB
testcase_04 AC 86 ms
75,260 KB
testcase_05 AC 81 ms
74,916 KB
testcase_06 AC 1,285 ms
123,152 KB
testcase_07 AC 159 ms
79,812 KB
testcase_08 AC 1,355 ms
124,236 KB
testcase_09 AC 1,596 ms
132,860 KB
testcase_10 AC 261 ms
85,012 KB
testcase_11 AC 360 ms
88,464 KB
testcase_12 AC 148 ms
79,456 KB
testcase_13 AC 600 ms
98,212 KB
testcase_14 AC 118 ms
77,788 KB
testcase_15 AC 306 ms
86,556 KB
testcase_16 AC 836 ms
106,896 KB
testcase_17 AC 961 ms
111,556 KB
testcase_18 AC 120 ms
78,016 KB
testcase_19 TLE -
testcase_20 AC 300 ms
86,700 KB
testcase_21 TLE -
testcase_22 AC 930 ms
110,376 KB
testcase_23 AC 708 ms
102,268 KB
testcase_24 AC 118 ms
77,904 KB
testcase_25 AC 169 ms
80,408 KB
testcase_26 AC 477 ms
93,208 KB
testcase_27 AC 1,068 ms
115,064 KB
testcase_28 TLE -
testcase_29 AC 393 ms
89,668 KB
testcase_30 AC 561 ms
96,280 KB
testcase_31 AC 142 ms
78,564 KB
testcase_32 AC 1,061 ms
113,992 KB
testcase_33 AC 696 ms
101,660 KB
testcase_34 AC 149 ms
79,436 KB
testcase_35 AC 246 ms
83,776 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N, M, Q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(Q)]
A.sort(key=lambda x: (x[0], -x[1]))

INF = 10**9
dp = [INF]*(N+M+1)
dp[0] = 0

for _, b in A:
    ind = bisect_left(dp, b)
    dp[ind] = min(dp[ind], b)

ans = 0
while dp[ans+1] < INF:
    ans += 1
print(ans)
0