結果

問題 No.1703 Much Matching
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-10-08 22:21:25
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,237 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 243,408 KB
最終ジャッジ日時 2023-09-30 10:46:25
合計ジャッジ時間 11,513 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,872 KB
testcase_01 AC 72 ms
70,596 KB
testcase_02 AC 73 ms
70,788 KB
testcase_03 AC 95 ms
75,976 KB
testcase_04 AC 94 ms
75,972 KB
testcase_05 AC 117 ms
80,648 KB
testcase_06 AC 356 ms
108,348 KB
testcase_07 AC 98 ms
78,760 KB
testcase_08 AC 404 ms
110,976 KB
testcase_09 AC 416 ms
112,280 KB
testcase_10 AC 133 ms
82,716 KB
testcase_11 AC 169 ms
90,120 KB
testcase_12 AC 102 ms
78,312 KB
testcase_13 AC 211 ms
91,568 KB
testcase_14 AC 91 ms
75,876 KB
testcase_15 AC 182 ms
89,776 KB
testcase_16 AC 259 ms
97,668 KB
testcase_17 AC 289 ms
97,804 KB
testcase_18 AC 90 ms
75,876 KB
testcase_19 AC 552 ms
132,368 KB
testcase_20 AC 126 ms
83,344 KB
testcase_21 AC 633 ms
143,860 KB
testcase_22 AC 316 ms
99,392 KB
testcase_23 AC 236 ms
92,532 KB
testcase_24 AC 89 ms
76,200 KB
testcase_25 AC 112 ms
80,188 KB
testcase_26 AC 216 ms
91,792 KB
testcase_27 AC 303 ms
101,128 KB
testcase_28 AC 584 ms
131,156 KB
testcase_29 AC 185 ms
90,332 KB
testcase_30 AC 212 ms
91,020 KB
testcase_31 AC 112 ms
79,076 KB
testcase_32 AC 321 ms
102,424 KB
testcase_33 AC 267 ms
95,636 KB
testcase_34 AC 101 ms
78,312 KB
testcase_35 AC 128 ms
81,616 KB
testcase_36 AC 1,237 ms
243,408 KB
testcase_37 AC 140 ms
84,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""
from sys import stdin
import sys

N,M,Q = map(int,stdin.readline().split())

dp = [[0] * (M+1) for i in range(N+1)]

ab = set()

for i in range(Q):

    a,b = map(int,stdin.readline().split())

    ab.add((a,b))

for i in range(N+1):
    for j in range(M+1):
        dp[i][j] = max(dp[i-1][j] , dp[i][j-1])
        if (i,j) in ab:
            dp[i][j] = max(dp[i][j] , dp[i-1][j-1] + 1)

print (dp[-1][-1])
0