結果

問題 No.1703 Much Matching
ユーザー gr1msl3ygr1msl3y
提出日時 2021-10-08 22:55:42
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,239 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 845 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 197,400 KB
最終ジャッジ日時 2023-09-30 12:08:46
合計ジャッジ時間 12,351 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,344 KB
testcase_01 AC 75 ms
71,576 KB
testcase_02 AC 75 ms
71,532 KB
testcase_03 AC 76 ms
71,384 KB
testcase_04 AC 85 ms
75,376 KB
testcase_05 AC 80 ms
75,312 KB
testcase_06 AC 413 ms
109,972 KB
testcase_07 AC 129 ms
79,476 KB
testcase_08 AC 435 ms
111,624 KB
testcase_09 AC 485 ms
117,208 KB
testcase_10 AC 163 ms
82,912 KB
testcase_11 AC 191 ms
85,720 KB
testcase_12 AC 122 ms
78,048 KB
testcase_13 AC 255 ms
92,508 KB
testcase_14 AC 119 ms
78,288 KB
testcase_15 AC 178 ms
84,140 KB
testcase_16 AC 311 ms
98,564 KB
testcase_17 AC 347 ms
102,032 KB
testcase_18 AC 115 ms
78,108 KB
testcase_19 AC 600 ms
129,528 KB
testcase_20 AC 172 ms
83,812 KB
testcase_21 AC 689 ms
138,684 KB
testcase_22 AC 332 ms
100,788 KB
testcase_23 AC 279 ms
94,804 KB
testcase_24 AC 113 ms
77,996 KB
testcase_25 AC 131 ms
79,828 KB
testcase_26 AC 217 ms
88,832 KB
testcase_27 AC 362 ms
103,944 KB
testcase_28 AC 583 ms
127,500 KB
testcase_29 AC 197 ms
86,612 KB
testcase_30 AC 242 ms
91,720 KB
testcase_31 AC 121 ms
78,108 KB
testcase_32 AC 361 ms
103,840 KB
testcase_33 AC 276 ms
94,784 KB
testcase_34 AC 125 ms
79,084 KB
testcase_35 AC 154 ms
81,932 KB
testcase_36 AC 1,239 ms
197,400 KB
testcase_37 AC 97 ms
76,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N, M, Q = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(Q)]
B = [0]*Q
for i in range(Q):
    a, b = A[i]
    c = 2**10-1-b
    B[i] = a*(2**10)+c
B.sort()

INF = 10**9
dp = [INF]*(N+M+1)
dp[0] = 0

for v in B:
    b = 2**10-1-(v % (2**10))
    ind = bisect_left(dp, b)
    dp[ind] = min(dp[ind], b)

ans = 0
while dp[ans+1] < INF:
    ans += 1
print(ans)
0