結果

問題 No.1703 Much Matching
ユーザー ああいいああいい
提出日時 2021-12-31 17:38:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 719 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 87,808 KB
最終ジャッジ日時 2024-04-17 05:45:20
合計ジャッジ時間 8,682 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,840 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 41 ms
51,712 KB
testcase_03 AC 62 ms
65,408 KB
testcase_04 AC 67 ms
65,920 KB
testcase_05 AC 72 ms
70,528 KB
testcase_06 AC 259 ms
79,872 KB
testcase_07 AC 94 ms
76,288 KB
testcase_08 AC 288 ms
87,808 KB
testcase_09 AC 311 ms
84,992 KB
testcase_10 AC 117 ms
78,464 KB
testcase_11 AC 137 ms
79,232 KB
testcase_12 AC 95 ms
77,184 KB
testcase_13 AC 168 ms
78,848 KB
testcase_14 AC 85 ms
71,936 KB
testcase_15 AC 140 ms
81,024 KB
testcase_16 AC 182 ms
77,824 KB
testcase_17 AC 209 ms
78,464 KB
testcase_18 AC 80 ms
70,272 KB
testcase_19 AC 351 ms
83,840 KB
testcase_20 AC 111 ms
76,928 KB
testcase_21 AC 407 ms
80,896 KB
testcase_22 AC 222 ms
81,280 KB
testcase_23 AC 191 ms
81,408 KB
testcase_24 AC 83 ms
71,424 KB
testcase_25 AC 104 ms
77,568 KB
testcase_26 AC 166 ms
81,408 KB
testcase_27 AC 221 ms
80,768 KB
testcase_28 AC 365 ms
83,200 KB
testcase_29 AC 153 ms
83,328 KB
testcase_30 AC 172 ms
82,176 KB
testcase_31 AC 102 ms
78,336 KB
testcase_32 AC 237 ms
81,920 KB
testcase_33 AC 198 ms
85,120 KB
testcase_34 AC 96 ms
76,672 KB
testcase_35 AC 116 ms
77,952 KB
testcase_36 AC 719 ms
85,248 KB
testcase_37 AC 114 ms
87,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for _ in range(Q):
    a,b = map(int,input().split())
    dat[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):
        dp[i][j] = max(dp[i-1][j],dp[i][j-1],dp[i-1][j-1] + dat[i][j])
print(dp[N][M])
0