結果

問題 No.1703 Much Matching
ユーザー kohei2019kohei2019
提出日時 2023-06-04 18:21:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 215,336 KB
最終ジャッジ日時 2023-08-28 08:19:17
合計ジャッジ時間 11,058 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,184 KB
testcase_01 AC 69 ms
71,460 KB
testcase_02 AC 70 ms
71,328 KB
testcase_03 AC 85 ms
76,440 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 293 ms
98,364 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 129 ms
78,716 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 103 ms
76,960 KB
testcase_15 WA -
testcase_16 AC 217 ms
87,252 KB
testcase_17 WA -
testcase_18 AC 98 ms
76,924 KB
testcase_19 WA -
testcase_20 AC 123 ms
78,196 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 100 ms
76,856 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 913 ms
215,336 KB
testcase_37 AC 134 ms
85,400 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,dp[i][j-1])
        else:
            dp[i][j] = max(dp[i-1][j],dp[i][j-1])
print(dp[-1][-1])
0