結果

問題 No.1703 Much Matching
ユーザー roarisroaris
提出日時 2021-10-17 20:13:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 302 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,524 KB
実行使用メモリ 223,480 KB
最終ジャッジ日時 2023-10-17 22:33:19
合計ジャッジ時間 28,676 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
57,796 KB
testcase_01 AC 38 ms
53,448 KB
testcase_02 AC 38 ms
53,448 KB
testcase_03 AC 38 ms
53,448 KB
testcase_04 AC 47 ms
61,712 KB
testcase_05 AC 43 ms
59,084 KB
testcase_06 AC 1,241 ms
117,024 KB
testcase_07 AC 100 ms
77,892 KB
testcase_08 AC 1,305 ms
118,548 KB
testcase_09 AC 1,551 ms
125,380 KB
testcase_10 AC 216 ms
82,456 KB
testcase_11 AC 315 ms
86,100 KB
testcase_12 AC 99 ms
77,588 KB
testcase_13 AC 571 ms
94,432 KB
testcase_14 AC 76 ms
76,220 KB
testcase_15 AC 262 ms
84,132 KB
testcase_16 AC 800 ms
102,320 KB
testcase_17 AC 945 ms
106,724 KB
testcase_18 AC 74 ms
76,216 KB
testcase_19 TLE -
testcase_20 AC 252 ms
83,736 KB
testcase_21 TLE -
testcase_22 AC 879 ms
105,440 KB
testcase_23 AC 661 ms
97,424 KB
testcase_24 AC 65 ms
72,792 KB
testcase_25 AC 118 ms
78,468 KB
testcase_26 AC 428 ms
90,032 KB
testcase_27 AC 1,021 ms
109,408 KB
testcase_28 TLE -
testcase_29 AC 342 ms
87,100 KB
testcase_30 AC 505 ms
93,120 KB
testcase_31 AC 86 ms
77,196 KB
testcase_32 AC 1,012 ms
109,320 KB
testcase_33 AC 647 ms
97,536 KB
testcase_34 AC 99 ms
77,648 KB
testcase_35 AC 183 ms
81,360 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from bisect import *

N, M, Q = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(Q)]
ab.sort(key=lambda t: (t[0], -t[1]))
dp = [10**18]*(N+1)
dp[0] = 0

for _, b in ab:
    dp[bisect_left(dp, b)] = b

print(bisect_left(dp, 10**18)-1)
0