結果

問題 No.1703 Much Matching
ユーザー H20H20
提出日時 2021-10-08 23:36:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 631 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 82,796 KB
実行使用メモリ 311,488 KB
最終ジャッジ日時 2024-07-23 07:53:06
合計ジャッジ時間 24,360 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
58,240 KB
testcase_01 AC 37 ms
52,224 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 42 ms
52,480 KB
testcase_04 AC 44 ms
59,264 KB
testcase_05 AC 41 ms
58,240 KB
testcase_06 AC 1,194 ms
155,480 KB
testcase_07 AC 99 ms
78,464 KB
testcase_08 AC 1,283 ms
156,960 KB
testcase_09 AC 1,481 ms
169,708 KB
testcase_10 AC 209 ms
86,476 KB
testcase_11 AC 297 ms
92,656 KB
testcase_12 AC 97 ms
78,564 KB
testcase_13 AC 545 ms
107,892 KB
testcase_14 AC 74 ms
76,544 KB
testcase_15 AC 246 ms
88,932 KB
testcase_16 AC 769 ms
123,416 KB
testcase_17 AC 904 ms
131,472 KB
testcase_18 AC 75 ms
76,700 KB
testcase_19 AC 1,999 ms
206,112 KB
testcase_20 AC 248 ms
88,832 KB
testcase_21 TLE -
testcase_22 AC 872 ms
130,280 KB
testcase_23 AC 611 ms
115,664 KB
testcase_24 AC 71 ms
76,160 KB
testcase_25 AC 116 ms
79,240 KB
testcase_26 AC 396 ms
100,456 KB
testcase_27 AC 940 ms
138,384 KB
testcase_28 AC 1,859 ms
196,232 KB
testcase_29 AC 317 ms
94,700 KB
testcase_30 AC 467 ms
104,432 KB
testcase_31 AC 85 ms
77,824 KB
testcase_32 AC 935 ms
137,716 KB
testcase_33 AC 584 ms
113,516 KB
testcase_34 AC 98 ms
78,132 KB
testcase_35 AC 178 ms
84,992 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect
from sys import stdin

def main():
    readline = stdin.readline
    # N: 数列の長さ
    # A[i]: a_i の値
    def solve(N, A):
        INF = 10**10

        dp = [INF]*(N+1)
        dp[0] = -1
        for a in A:
            idx = bisect(dp, a-1)
            dp[idx] = min(a, dp[idx])
        return max(i for i in range(N+1) if dp[i] < INF)

    N,M,Q = map(int, readline().split())
    WH = []
    for i in range(Q):
        WH.append(list(map(int,readline().split())))
    WH = sorted(WH,key=lambda x:(x[0],-x[1]))
    H = []
    for w,h in WH:
        H.append(h)

    print(solve(N,H))

main()
0