結果

問題 No.1703 Much Matching
ユーザー ああいいああいい
提出日時 2021-12-31 17:37:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,636 KB
最終ジャッジ日時 2024-04-17 05:44:40
合計ジャッジ時間 29,840 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
16,256 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 272 ms
14,976 KB
testcase_04 AC 187 ms
13,696 KB
testcase_05 AC 516 ms
19,328 KB
testcase_06 AC 1,260 ms
17,024 KB
testcase_07 AC 101 ms
11,392 KB
testcase_08 AC 1,691 ms
23,424 KB
testcase_09 AC 1,595 ms
19,968 KB
testcase_10 AC 304 ms
13,056 KB
testcase_11 AC 592 ms
16,896 KB
testcase_12 AC 135 ms
11,904 KB
testcase_13 AC 671 ms
15,488 KB
testcase_14 AC 57 ms
11,008 KB
testcase_15 AC 760 ms
20,352 KB
testcase_16 AC 763 ms
13,952 KB
testcase_17 AC 897 ms
14,848 KB
testcase_18 AC 42 ms
10,880 KB
testcase_19 AC 1,824 ms
18,304 KB
testcase_20 AC 238 ms
11,520 KB
testcase_21 TLE -
testcase_22 AC 1,225 ms
21,632 KB
testcase_23 AC 799 ms
16,128 KB
testcase_24 AC 57 ms
11,008 KB
testcase_25 AC 238 ms
13,440 KB
testcase_26 AC 903 ms
20,992 KB
testcase_27 AC 965 ms
15,104 KB
testcase_28 TLE -
testcase_29 AC 647 ms
17,792 KB
testcase_30 AC 749 ms
17,408 KB
testcase_31 AC 206 ms
13,568 KB
testcase_32 AC 1,205 ms
19,456 KB
testcase_33 AC 1,108 ms
22,016 KB
testcase_34 AC 108 ms
11,520 KB
testcase_35 AC 284 ms
13,440 KB
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,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