結果

問題 No.1703 Much Matching
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-10-09 11:04:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 710 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 85,964 KB
最終ジャッジ日時 2023-10-01 06:12:26
合計ジャッジ時間 10,375 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,008 KB
testcase_01 AC 77 ms
71,248 KB
testcase_02 AC 80 ms
71,204 KB
testcase_03 AC 92 ms
76,136 KB
testcase_04 AC 95 ms
75,860 KB
testcase_05 AC 104 ms
76,060 KB
testcase_06 AC 334 ms
80,480 KB
testcase_07 AC 116 ms
77,588 KB
testcase_08 AC 311 ms
84,348 KB
testcase_09 AC 321 ms
81,816 KB
testcase_10 AC 137 ms
78,656 KB
testcase_11 AC 161 ms
80,752 KB
testcase_12 AC 116 ms
77,852 KB
testcase_13 AC 189 ms
79,612 KB
testcase_14 AC 118 ms
76,580 KB
testcase_15 AC 167 ms
82,048 KB
testcase_16 AC 214 ms
78,868 KB
testcase_17 AC 229 ms
79,412 KB
testcase_18 AC 105 ms
76,812 KB
testcase_19 AC 362 ms
80,844 KB
testcase_20 AC 128 ms
77,564 KB
testcase_21 AC 406 ms
82,116 KB
testcase_22 AC 245 ms
82,572 KB
testcase_23 AC 202 ms
80,012 KB
testcase_24 AC 106 ms
76,828 KB
testcase_25 AC 121 ms
78,980 KB
testcase_26 AC 179 ms
82,192 KB
testcase_27 AC 247 ms
79,328 KB
testcase_28 AC 393 ms
85,132 KB
testcase_29 AC 162 ms
80,852 KB
testcase_30 AC 182 ms
80,532 KB
testcase_31 AC 117 ms
78,788 KB
testcase_32 AC 251 ms
81,588 KB
testcase_33 AC 215 ms
83,068 KB
testcase_34 AC 114 ms
77,800 KB
testcase_35 AC 132 ms
78,800 KB
testcase_36 AC 710 ms
85,964 KB
testcase_37 AC 124 ms
84,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,q = map(int,input().split())
dp = [[0] * (m+1) for _ in range(n+1)]
for i in range(q):
    a,b = map(int,input().split())
    dp[a][b] = 1
min_ = 0
for i in range(1,n+1):
    for j in range(1,m+1):
        if dp[i][j] == 1:
            dp[i][j] += dp[i-1][j-1]
        else:
            dp[i][j] = max(dp[i-1][j],dp[i][j-1])
        
#         for _ in dp:
#             print(_)
#         print(i,j)

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