結果

問題 No.1703 Much Matching
ユーザー mink1618033
提出日時 2021-10-09 01:56:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 190,112 KB
最終ジャッジ日時 2024-07-23 11:14:19
合計ジャッジ時間 23,888 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 31 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()
li = []
for a,b in ab:
    li.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(li))
0