結果

問題 No.1703 Much Matching
ユーザー Kiri8128Kiri8128
提出日時 2021-10-08 22:41:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 292 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 152,556 KB
最終ジャッジ日時 2023-09-30 11:43:28
合計ジャッジ時間 20,597 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
78,700 KB
testcase_01 AC 68 ms
71,040 KB
testcase_02 AC 68 ms
71,048 KB
testcase_03 AC 88 ms
75,068 KB
testcase_04 AC 77 ms
74,684 KB
testcase_05 AC 76 ms
74,604 KB
testcase_06 AC 833 ms
89,056 KB
testcase_07 AC 109 ms
77,532 KB
testcase_08 AC 995 ms
90,124 KB
testcase_09 AC 1,115 ms
92,656 KB
testcase_10 AC 190 ms
77,660 KB
testcase_11 AC 257 ms
78,316 KB
testcase_12 AC 117 ms
77,004 KB
testcase_13 AC 394 ms
80,396 KB
testcase_14 AC 102 ms
77,096 KB
testcase_15 AC 243 ms
78,460 KB
testcase_16 AC 483 ms
81,988 KB
testcase_17 AC 503 ms
83,920 KB
testcase_18 AC 100 ms
77,428 KB
testcase_19 AC 1,288 ms
101,888 KB
testcase_20 AC 189 ms
77,912 KB
testcase_21 AC 1,590 ms
106,668 KB
testcase_22 AC 680 ms
84,552 KB
testcase_23 AC 429 ms
80,816 KB
testcase_24 AC 102 ms
77,412 KB
testcase_25 AC 132 ms
77,032 KB
testcase_26 AC 361 ms
80,028 KB
testcase_27 AC 529 ms
84,988 KB
testcase_28 AC 1,487 ms
99,468 KB
testcase_29 AC 275 ms
78,816 KB
testcase_30 AC 373 ms
79,924 KB
testcase_31 AC 118 ms
77,188 KB
testcase_32 AC 811 ms
85,996 KB
testcase_33 AC 519 ms
81,348 KB
testcase_34 AC 121 ms
77,452 KB
testcase_35 AC 160 ms
77,496 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, Q = map(int, input().split())
X = [[] for _ in range(N)]
for _ in range(Q):
    a, b = map(int, input().split())
    X[a-1].append(b - 1)

Y = [0] * (M + 1)
for i, x in enumerate(X):
    nY = Y[:]
    for b in x:
        nY[b+1] = max(nY[b+1], max(Y[:b+1]) + 1)
    Y = nY
print(max(Y))
0