結果
| 問題 | 
                            No.1703 Much Matching
                             | 
                    
| コンテスト | |
| ユーザー | 
                             gew1fw
                         | 
                    
| 提出日時 | 2025-06-12 19:58:58 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 364 bytes | 
| コンパイル時間 | 177 ms | 
| コンパイル使用メモリ | 82,276 KB | 
| 実行使用メモリ | 178,328 KB | 
| 最終ジャッジ日時 | 2025-06-12 20:02:22 | 
| 合計ジャッジ時間 | 20,225 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 8 WA * 25 TLE * 1 -- * 1 | 
ソースコード
import bisect
n, m, q = map(int, input().split())
pairs = []
for _ in range(q):
    a, b = map(int, input().split())
    pairs.append((a, b))
pairs.sort()
b_list = [b for a, b in pairs]
tails = []
for num in b_list:
    idx = bisect.bisect_left(tails, num)
    if idx < len(tails):
        tails[idx] = num
    else:
        tails.append(num)
print(len(tails))
            
            
            
        
            
gew1fw