結果

問題 No.1703 Much Matching
ユーザー ああいいああいい
提出日時 2021-12-31 17:36:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,064 KB
最終ジャッジ日時 2024-04-17 05:42:01
合計ジャッジ時間 24,192 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
16,128 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 275 ms
15,104 KB
testcase_04 AC 191 ms
13,568 KB
testcase_05 AC 519 ms
19,328 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 WA -
testcase_11 RE -
testcase_12 WA -
testcase_13 RE -
testcase_14 WA -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 RE -
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

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,N + 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