結果
| 問題 | No.1703 Much Matching |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-23 01:10:20 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 636 ms / 2,000 ms |
| コード長 | 379 bytes |
| 記録 | |
| コンパイル時間 | 296 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 193,024 KB |
| 最終ジャッジ日時 | 2026-05-22 12:01:06 |
| 合計ジャッジ時間 | 7,018 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))