結果

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

ソースコード

diff #

def main():
	import sys
	input = sys.stdin.buffer.readline
	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))
if __name__ == '__main__':
	main()
	
0