結果

問題 No.1703 Much Matching
ユーザー gr1msl3ygr1msl3y
提出日時 2021-10-08 22:50:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 344 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 190,448 KB
最終ジャッジ日時 2023-09-30 11:59:41
合計ジャッジ時間 28,518 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
78,440 KB
testcase_01 AC 68 ms
71,332 KB
testcase_02 AC 68 ms
71,152 KB
testcase_03 AC 71 ms
71,664 KB
testcase_04 AC 79 ms
75,548 KB
testcase_05 AC 75 ms
75,396 KB
testcase_06 AC 1,359 ms
107,804 KB
testcase_07 AC 150 ms
79,308 KB
testcase_08 AC 1,430 ms
109,992 KB
testcase_09 AC 1,702 ms
115,532 KB
testcase_10 AC 265 ms
82,756 KB
testcase_11 AC 368 ms
85,620 KB
testcase_12 AC 146 ms
79,168 KB
testcase_13 AC 628 ms
91,748 KB
testcase_14 AC 113 ms
78,052 KB
testcase_15 AC 311 ms
84,152 KB
testcase_16 AC 886 ms
97,552 KB
testcase_17 AC 1,037 ms
100,952 KB
testcase_18 AC 114 ms
78,140 KB
testcase_19 TLE -
testcase_20 AC 302 ms
83,628 KB
testcase_21 TLE -
testcase_22 AC 952 ms
99,756 KB
testcase_23 AC 714 ms
94,408 KB
testcase_24 AC 112 ms
78,108 KB
testcase_25 AC 162 ms
79,784 KB
testcase_26 AC 476 ms
88,360 KB
testcase_27 AC 1,085 ms
102,736 KB
testcase_28 TLE -
testcase_29 AC 395 ms
86,220 KB
testcase_30 AC 575 ms
90,676 KB
testcase_31 AC 130 ms
78,380 KB
testcase_32 AC 1,105 ms
102,800 KB
testcase_33 AC 710 ms
94,352 KB
testcase_34 AC 141 ms
79,044 KB
testcase_35 AC 238 ms
82,040 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N, M, Q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(Q)]
for i in range(Q):
    A[i][1] *= -1
A.sort()

INF = 10**9
dp = [INF]*(N+M+1)
dp[0] = 0

for _, b in A:
    ind = bisect_left(dp, -b)
    dp[ind] = min(dp[ind], -b)

ans = 0
while dp[ans+1] < INF:
    ans += 1
print(ans)
0