結果

問題 No.1703 Much Matching
ユーザー mink1618033
提出日時 2021-10-09 01:53:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 189,956 KB
最終ジャッジ日時 2024-07-23 11:10:30
合計ジャッジ時間 25,727 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 25 TLE * 3 -- * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

ab.sort()
li = []
for a,b in ab:
    li.append(b)

def LIS(L):
  from bisect import bisect_left
  seq = []
  for ai in L:
    pos = bisect_left(seq, ai)
    if len(seq) <= pos:
      seq.append(ai)
    else:
      seq[pos] = ai
  return len(seq)

print(LIS(li))
0