結果
問題 | No.1703 Much Matching |
ユーザー |
![]() |
提出日時 | 2021-10-08 23:03:00 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 633 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 199,624 KB |
最終ジャッジ日時 | 2024-07-23 06:24:33 |
合計ジャッジ時間 | 17,067 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
57,600 KB |
testcase_01 | AC | 42 ms
52,480 KB |
testcase_02 | AC | 38 ms
52,224 KB |
testcase_03 | AC | 39 ms
53,248 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | TLE | - |
testcase_07 | WA | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | TLE | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
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 | -- | - |
ソースコード
n,m,q = map(int,input().split()) l1,l2 = [],[] for _ in range(q): a,b = map(int,input().split()) l1.append((a,b)) l2.append((b,a)) import bisect def lis(l): l.sort(key = lambda x:(x[0],x[1])) flg = 0 ll = [] for i in range(q): if l[i][0] != flg: ll.append(l[i][1]) flg = l[i][0] nn = len(ll) dp = [] for i in range(nn): idx = bisect.bisect_left(dp,ll[i]) # print(i,ll[i],idx,dp) if idx == len(dp): dp.append(ll[i]) else: dp[idx] = ll[i] # print(l,ll,dp) return len(dp) print(max(lis(l1),lis(l2)))