結果

問題 No.1703 Much Matching
ユーザー gr1msl3ygr1msl3y
提出日時 2022-02-23 23:47:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 701 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 90,096 KB
最終ジャッジ日時 2023-09-14 16:53:59
合計ジャッジ時間 11,807 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,052 KB
testcase_01 AC 73 ms
71,144 KB
testcase_02 AC 74 ms
71,344 KB
testcase_03 AC 87 ms
76,316 KB
testcase_04 AC 89 ms
76,204 KB
testcase_05 AC 93 ms
76,316 KB
testcase_06 AC 265 ms
80,624 KB
testcase_07 AC 110 ms
77,616 KB
testcase_08 AC 300 ms
90,096 KB
testcase_09 AC 310 ms
86,028 KB
testcase_10 AC 132 ms
79,220 KB
testcase_11 AC 157 ms
83,580 KB
testcase_12 AC 111 ms
77,884 KB
testcase_13 AC 183 ms
79,784 KB
testcase_14 AC 103 ms
76,496 KB
testcase_15 AC 154 ms
82,220 KB
testcase_16 AC 202 ms
78,816 KB
testcase_17 AC 226 ms
79,572 KB
testcase_18 AC 102 ms
76,860 KB
testcase_19 AC 364 ms
84,876 KB
testcase_20 AC 125 ms
77,720 KB
testcase_21 AC 414 ms
83,704 KB
testcase_22 AC 241 ms
82,328 KB
testcase_23 AC 206 ms
82,696 KB
testcase_24 AC 105 ms
76,504 KB
testcase_25 AC 119 ms
78,816 KB
testcase_26 AC 182 ms
82,436 KB
testcase_27 AC 238 ms
82,052 KB
testcase_28 AC 387 ms
84,936 KB
testcase_29 AC 167 ms
83,040 KB
testcase_30 AC 184 ms
81,820 KB
testcase_31 AC 118 ms
79,048 KB
testcase_32 AC 251 ms
82,928 KB
testcase_33 AC 212 ms
85,492 KB
testcase_34 AC 114 ms
77,652 KB
testcase_35 AC 135 ms
80,432 KB
testcase_36 AC 701 ms
86,044 KB
testcase_37 AC 127 ms
87,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, Q = map(int, input().split())
A = [[0]*(M+1) for _ in range(N+1)]
for _ in range(Q):
    a, b = map(int, input().split())
    A[a][b] = 1

dp = [[0]*(M+1) for _ in range(N+1)]
for i in range(1, N+1):
    for j in range(1, M+1):
        if A[i][j]:
            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