結果

問題 No.1703 Much Matching
ユーザー NatsubiSogan
提出日時 2021-10-08 22:33:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 270 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 243,272 KB
最終ジャッジ日時 2024-07-23 05:32:07
合計ジャッジ時間 26,795 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 TLE * 4 -- * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, q = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(q)]
ab.sort(key=lambda x: (x[0], -x[1]))
INF = 10 ** 9
from bisect import bisect_left
dp = [INF] * (q + 1)
for a, b in ab:
    dp[bisect_left(dp, b)] = b
print(bisect_left(dp, INF))
0