結果

問題 No.1703 Much Matching
ユーザー mink1618033
提出日時 2021-10-09 17:44:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 198,832 KB
最終ジャッジ日時 2024-09-13 03:47:24
合計ジャッジ時間 24,393 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 24 TLE * 2 -- * 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(key=lambda x:(x[0],-x[1]))
lia = []
for a,b in ab:
    lia.append(b)

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

print(LIS(lia))
0