結果

問題 No.1703 Much Matching
ユーザー kohei2019kohei2019
提出日時 2023-06-04 18:22:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 921 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 215,432 KB
最終ジャッジ日時 2023-08-28 08:19:35
合計ジャッジ時間 10,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,464 KB
testcase_01 AC 73 ms
71,436 KB
testcase_02 AC 73 ms
71,368 KB
testcase_03 AC 89 ms
76,412 KB
testcase_04 AC 94 ms
76,556 KB
testcase_05 AC 96 ms
76,784 KB
testcase_06 AC 297 ms
98,552 KB
testcase_07 AC 114 ms
77,956 KB
testcase_08 AC 335 ms
106,872 KB
testcase_09 AC 360 ms
107,544 KB
testcase_10 AC 133 ms
78,756 KB
testcase_11 AC 168 ms
82,944 KB
testcase_12 AC 113 ms
77,708 KB
testcase_13 AC 193 ms
82,384 KB
testcase_14 AC 104 ms
77,016 KB
testcase_15 AC 160 ms
78,848 KB
testcase_16 AC 216 ms
87,276 KB
testcase_17 AC 252 ms
92,360 KB
testcase_18 AC 100 ms
77,056 KB
testcase_19 AC 425 ms
126,164 KB
testcase_20 AC 128 ms
78,376 KB
testcase_21 AC 503 ms
133,840 KB
testcase_22 AC 258 ms
92,608 KB
testcase_23 AC 219 ms
84,340 KB
testcase_24 AC 103 ms
77,040 KB
testcase_25 AC 119 ms
77,948 KB
testcase_26 AC 200 ms
86,960 KB
testcase_27 AC 266 ms
98,544 KB
testcase_28 AC 447 ms
119,524 KB
testcase_29 AC 170 ms
80,136 KB
testcase_30 AC 188 ms
82,536 KB
testcase_31 AC 121 ms
78,000 KB
testcase_32 AC 277 ms
97,352 KB
testcase_33 AC 225 ms
85,620 KB
testcase_34 AC 111 ms
77,536 KB
testcase_35 AC 135 ms
80,164 KB
testcase_36 AC 921 ms
215,432 KB
testcase_37 AC 133 ms
85,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,Q = map(int,input().split())
lsAB = [set() for i in range(N+1)]
for i in range(Q):
    a,b = map(int,input().split())
    lsAB[a].add(b)
dp = [[0]*(M+1) for i in range(N+1)]

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