結果
| 問題 | No.1703 Much Matching |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-01-23 01:10:20 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 568 ms / 2,000 ms |
| + 380µs | |
| コード長 | 379 bytes |
| 記録 | |
| コンパイル時間 | 622 ms |
| コンパイル使用メモリ | 81,684 KB |
| 実行使用メモリ | 209,204 KB |
| 最終ジャッジ日時 | 2026-10-01 09:17:50 |
| 合計ジャッジ時間 | 8,892 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
from bisect import bisect_left
n, m, q = map(int, input().split())
lst = [[] for _ in range(n)]
for _ in range(q):
x, y = map(int, input().split())
lst[x - 1].append(y)
Y = []
for ls in lst:
ls.sort(reverse = True)
Y += ls
lst = []
for y in Y:
p = bisect_left(lst, y)
if p == len(lst):
lst.append(y)
else:
lst[p] = y
print(len(lst))