結果

問題 No.1703 Much Matching
ユーザー puznekopuzneko
提出日時 2021-10-30 00:03:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 390,680 KB
最終ジャッジ日時 2024-04-16 16:02:47
合計ジャッジ時間 23,375 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
57,984 KB
testcase_01 AC 44 ms
52,380 KB
testcase_02 AC 44 ms
52,152 KB
testcase_03 AC 43 ms
52,096 KB
testcase_04 AC 47 ms
58,640 KB
testcase_05 AC 43 ms
52,992 KB
testcase_06 AC 1,048 ms
183,832 KB
testcase_07 AC 103 ms
79,500 KB
testcase_08 AC 1,118 ms
185,292 KB
testcase_09 AC 1,279 ms
190,808 KB
testcase_10 AC 198 ms
92,652 KB
testcase_11 AC 282 ms
104,700 KB
testcase_12 AC 95 ms
78,068 KB
testcase_13 AC 481 ms
120,404 KB
testcase_14 AC 66 ms
71,552 KB
testcase_15 AC 234 ms
98,468 KB
testcase_16 AC 688 ms
135,044 KB
testcase_17 AC 804 ms
152,084 KB
testcase_18 AC 68 ms
72,140 KB
testcase_19 AC 1,720 ms
220,696 KB
testcase_20 AC 222 ms
97,432 KB
testcase_21 TLE -
testcase_22 AC 761 ms
148,216 KB
testcase_23 AC 582 ms
133,120 KB
testcase_24 AC 62 ms
69,120 KB
testcase_25 AC 107 ms
80,128 KB
testcase_26 AC 366 ms
118,220 KB
testcase_27 AC 876 ms
163,648 KB
testcase_28 AC 1,611 ms
200,628 KB
testcase_29 AC 299 ms
108,224 KB
testcase_30 AC 437 ms
119,168 KB
testcase_31 AC 85 ms
76,876 KB
testcase_32 AC 869 ms
164,052 KB
testcase_33 AC 545 ms
125,776 KB
testcase_34 AC 94 ms
78,224 KB
testcase_35 AC 170 ms
90,048 KB
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
import bisect
n, m, q, *indata = map(int, stdin.read().split())
offset = 0
hq = []
for i in range(q):
    s, t = indata[offset + 2*i],indata[offset + 2*i+1]
    hq.append((s,-t))

hq.sort()
dp = [-hq[0][1]]
ans = 1
for i in range(1,q):
    a = -hq[i][1]
    kari = bisect.bisect_left(dp,a)
    if kari == ans:
        dp.append(a)
        ans += 1
    else:
        dp[kari] = a
print("{}".format(ans))

0