結果

問題 No.1703 Much Matching
ユーザー lloyzlloyz
提出日時 2023-08-01 07:30:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 688 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 92,756 KB
最終ジャッジ日時 2024-04-19 07:04:53
合計ジャッジ時間 8,882 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,112 KB
testcase_01 AC 36 ms
51,876 KB
testcase_02 AC 35 ms
52,532 KB
testcase_03 AC 55 ms
68,996 KB
testcase_04 AC 59 ms
69,376 KB
testcase_05 AC 62 ms
73,292 KB
testcase_06 AC 235 ms
79,504 KB
testcase_07 AC 82 ms
76,648 KB
testcase_08 AC 271 ms
87,344 KB
testcase_09 AC 282 ms
82,820 KB
testcase_10 AC 100 ms
78,804 KB
testcase_11 AC 129 ms
82,292 KB
testcase_12 AC 81 ms
76,768 KB
testcase_13 AC 153 ms
78,672 KB
testcase_14 AC 70 ms
73,284 KB
testcase_15 AC 128 ms
80,948 KB
testcase_16 AC 171 ms
78,040 KB
testcase_17 AC 194 ms
78,504 KB
testcase_18 AC 67 ms
71,576 KB
testcase_19 AC 329 ms
82,460 KB
testcase_20 AC 95 ms
76,464 KB
testcase_21 AC 380 ms
81,000 KB
testcase_22 AC 209 ms
81,480 KB
testcase_23 AC 171 ms
80,884 KB
testcase_24 AC 68 ms
73,444 KB
testcase_25 AC 89 ms
77,772 KB
testcase_26 AC 152 ms
81,572 KB
testcase_27 AC 204 ms
79,892 KB
testcase_28 AC 348 ms
83,976 KB
testcase_29 AC 135 ms
81,228 KB
testcase_30 AC 157 ms
80,188 KB
testcase_31 AC 89 ms
77,796 KB
testcase_32 AC 227 ms
80,668 KB
testcase_33 AC 185 ms
83,524 KB
testcase_34 AC 81 ms
76,464 KB
testcase_35 AC 105 ms
78,992 KB
testcase_36 AC 688 ms
92,756 KB
testcase_37 AC 99 ms
85,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, q = map(int, input().split())
C = [[0 for _ in range(m)] for _ in range(n)]
for _ in range(q):
    a, b = map(int, input().split())
    C[a - 1][b - 1] = 1

DP = [[0 for _ in range(m + 1)] for _ in range(n + 1)]
for i in range(1, n + 1):
    for j in range(1, m + 1):
        if C[i - 1][j - 1] == 1:
            DP[i][j] = DP[i - 1][j - 1] + 1
        else:
            DP[i][j] = max(DP[i - 1][j], DP[i][j - 1])
print(DP[n][m])
0