結果

問題 No.1703 Much Matching
ユーザー 👑 rin204rin204
提出日時 2022-01-23 01:07:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 241,720 KB
最終ジャッジ日時 2023-08-18 23:26:51
合計ジャッジ時間 25,525 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,448 KB
testcase_01 AC 63 ms
71,440 KB
testcase_02 AC 63 ms
71,336 KB
testcase_03 AC 63 ms
71,332 KB
testcase_04 AC 70 ms
75,084 KB
testcase_05 AC 65 ms
71,284 KB
testcase_06 AC 1,084 ms
123,188 KB
testcase_07 AC 137 ms
79,876 KB
testcase_08 AC 1,130 ms
124,412 KB
testcase_09 AC 1,330 ms
133,452 KB
testcase_10 AC 229 ms
84,964 KB
testcase_11 AC 306 ms
88,960 KB
testcase_12 AC 127 ms
79,516 KB
testcase_13 AC 519 ms
98,704 KB
testcase_14 AC 105 ms
77,984 KB
testcase_15 AC 260 ms
86,908 KB
testcase_16 AC 707 ms
106,824 KB
testcase_17 AC 817 ms
111,644 KB
testcase_18 AC 108 ms
78,100 KB
testcase_19 AC 1,827 ms
150,432 KB
testcase_20 AC 256 ms
86,536 KB
testcase_21 TLE -
testcase_22 AC 793 ms
110,360 KB
testcase_23 AC 604 ms
102,480 KB
testcase_24 AC 103 ms
77,908 KB
testcase_25 AC 148 ms
80,376 KB
testcase_26 AC 406 ms
93,236 KB
testcase_27 AC 906 ms
114,832 KB
testcase_28 AC 1,735 ms
146,952 KB
testcase_29 AC 330 ms
90,168 KB
testcase_30 AC 481 ms
96,600 KB
testcase_31 AC 119 ms
78,752 KB
testcase_32 AC 912 ms
114,696 KB
testcase_33 AC 583 ms
101,856 KB
testcase_34 AC 128 ms
79,364 KB
testcase_35 AC 209 ms
83,964 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

n, m, q = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(q)]
xy.sort(key = lambda x:(x[0], -x[1]))
lst = []

for _, y in xy:
    p = bisect_left(lst, y)
    if p == len(lst):
        lst.append(y)
    else:
        lst[p] = y

print(len(lst))
0