結果
問題 | No.1703 Much Matching |
ユーザー | mkawa2 |
提出日時 | 2021-10-08 22:28:07 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 827 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 10,880 KB |
実行使用メモリ | 132,344 KB |
最終ジャッジ日時 | 2023-09-30 11:02:36 |
合計ジャッジ時間 | 16,432 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
8,000 KB |
testcase_01 | AC | 16 ms
7,940 KB |
testcase_02 | AC | 16 ms
7,812 KB |
testcase_03 | AC | 16 ms
7,788 KB |
testcase_04 | AC | 17 ms
8,200 KB |
testcase_05 | AC | 17 ms
7,780 KB |
testcase_06 | AC | 1,533 ms
84,104 KB |
testcase_07 | AC | 62 ms
11,912 KB |
testcase_08 | AC | 1,683 ms
90,412 KB |
testcase_09 | AC | 1,926 ms
102,176 KB |
testcase_10 | AC | 203 ms
20,076 KB |
testcase_11 | AC | 331 ms
27,304 KB |
testcase_12 | AC | 61 ms
11,268 KB |
testcase_13 | AC | 641 ms
43,092 KB |
testcase_14 | AC | 28 ms
9,180 KB |
testcase_15 | AC | 267 ms
23,916 KB |
testcase_16 | AC | 942 ms
55,896 KB |
testcase_17 | AC | 1,087 ms
64,072 KB |
testcase_18 | AC | 26 ms
9,008 KB |
testcase_19 | TLE | - |
testcase_20 | AC | 241 ms
22,148 KB |
testcase_21 | TLE | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
ソースコード
import sys sys.setrecursionlimit(200005) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] md = 10**9+7 class BitMax: def __init__(self, n): self.inf = 10**9 self.n = n self.table = [-self.inf]*(self.n+1) def update(self, i, x): i += 1 while i <= self.n: if x > self.table[i]: self.table[i] = x i += i & -i def max(self, i): i += 1 res = -self.inf while i > 0: if self.table[i] > res: res = self.table[i] i -= i & -i return res n, m, q = LI() ab = LLI(q) ab.sort(key=lambda x: (x[0], -x[1])) bit = BitMax(m+5) bit.update(0, 0) for a, b in ab: pre = bit.max(b-1) bit.update(b, pre+1) print(bit.max(m+4))