結果

問題 No.1703 Much Matching
ユーザー 河野竜也河野竜也
提出日時 2022-06-22 22:26:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 703 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 88,192 KB
最終ジャッジ日時 2024-04-24 02:22:08
合計ジャッジ時間 8,415 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 42 ms
51,840 KB
testcase_02 AC 46 ms
51,968 KB
testcase_03 AC 59 ms
65,408 KB
testcase_04 AC 64 ms
65,920 KB
testcase_05 AC 69 ms
70,528 KB
testcase_06 AC 253 ms
79,744 KB
testcase_07 AC 96 ms
76,672 KB
testcase_08 AC 285 ms
88,192 KB
testcase_09 AC 296 ms
84,864 KB
testcase_10 AC 114 ms
78,976 KB
testcase_11 AC 138 ms
79,488 KB
testcase_12 AC 92 ms
77,184 KB
testcase_13 AC 171 ms
79,104 KB
testcase_14 AC 82 ms
72,192 KB
testcase_15 AC 138 ms
81,280 KB
testcase_16 AC 189 ms
78,080 KB
testcase_17 AC 212 ms
78,848 KB
testcase_18 AC 77 ms
70,144 KB
testcase_19 AC 350 ms
83,968 KB
testcase_20 AC 108 ms
76,672 KB
testcase_21 AC 408 ms
81,280 KB
testcase_22 AC 228 ms
81,792 KB
testcase_23 AC 187 ms
82,176 KB
testcase_24 AC 82 ms
71,552 KB
testcase_25 AC 100 ms
77,952 KB
testcase_26 AC 161 ms
81,408 KB
testcase_27 AC 225 ms
81,024 KB
testcase_28 AC 369 ms
83,328 KB
testcase_29 AC 149 ms
83,072 KB
testcase_30 AC 171 ms
81,920 KB
testcase_31 AC 98 ms
78,720 KB
testcase_32 AC 238 ms
82,048 KB
testcase_33 AC 197 ms
85,760 KB
testcase_34 AC 95 ms
77,184 KB
testcase_35 AC 115 ms
78,080 KB
testcase_36 AC 703 ms
84,992 KB
testcase_37 AC 108 ms
87,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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