結果

問題 No.1703 Much Matching
ユーザー gew1fw
提出日時 2025-06-12 14:47:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 212,608 KB
最終ジャッジ日時 2025-06-12 14:49:27
合計ジャッジ時間 13,591 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 25 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n, m, q = map(int, input().split())
pairs = [tuple(map(int, input().split())) for _ in range(q)]
pairs.sort(key=lambda x: x[0])
ys = [b for a, b in pairs]

tails = []
for y in ys:
    idx = bisect.bisect_left(tails, y)
    if idx == len(tails):
        tails.append(y)
    else:
        tails[idx] = y

print(len(tails))
0