結果

問題 No.1703 Much Matching
ユーザー chineristACchineristAC
提出日時 2021-10-08 22:17:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 489 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 145,240 KB
最終ジャッジ日時 2023-09-30 10:40:35
合計ジャッジ時間 8,731 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
74,128 KB
testcase_01 AC 108 ms
74,600 KB
testcase_02 AC 111 ms
74,508 KB
testcase_03 AC 122 ms
79,124 KB
testcase_04 AC 117 ms
79,284 KB
testcase_05 AC 124 ms
79,304 KB
testcase_06 AC 207 ms
88,904 KB
testcase_07 AC 133 ms
81,292 KB
testcase_08 AC 226 ms
91,560 KB
testcase_09 AC 237 ms
93,856 KB
testcase_10 AC 142 ms
81,676 KB
testcase_11 AC 154 ms
81,864 KB
testcase_12 AC 135 ms
81,252 KB
testcase_13 AC 171 ms
83,936 KB
testcase_14 AC 123 ms
79,744 KB
testcase_15 AC 155 ms
81,704 KB
testcase_16 AC 180 ms
85,092 KB
testcase_17 AC 192 ms
86,980 KB
testcase_18 AC 124 ms
79,568 KB
testcase_19 AC 270 ms
102,828 KB
testcase_20 AC 137 ms
81,340 KB
testcase_21 AC 304 ms
108,040 KB
testcase_22 AC 193 ms
86,712 KB
testcase_23 AC 176 ms
83,928 KB
testcase_24 AC 122 ms
79,452 KB
testcase_25 AC 137 ms
81,316 KB
testcase_26 AC 169 ms
82,712 KB
testcase_27 AC 201 ms
86,772 KB
testcase_28 AC 281 ms
99,408 KB
testcase_29 AC 157 ms
81,380 KB
testcase_30 AC 167 ms
82,480 KB
testcase_31 AC 138 ms
81,352 KB
testcase_32 AC 200 ms
86,940 KB
testcase_33 AC 177 ms
83,672 KB
testcase_34 AC 131 ms
81,512 KB
testcase_35 AC 142 ms
81,472 KB
testcase_36 AC 489 ms
145,240 KB
testcase_37 AC 130 ms
80,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random
from collections import deque
from heapq import heappush,heappop

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,M,Q = mi()

pair = [[] for i in range(N+1)]
for _ in range(Q):
    a,b = mi()
    pair[a].append(b)

INF = 10**9
dp = [0 for w in range(M+1)]
for i in range(N):
    ndp = [x for x in dp]
    for w in pair[i+1]:
        ndp[w] = max(ndp[w],dp[w-1]+1)
    dp = ndp
    for w in range(1,M+1):
        dp[w] = max(dp[w],dp[w-1])

print(max(dp))




0