結果

問題 No.1703 Much Matching
ユーザー mink1618033mink1618033
提出日時 2021-10-09 17:44:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 1,276 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 241,092 KB
最終ジャッジ日時 2023-10-11 04:26:30
合計ジャッジ時間 29,298 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,888 KB
testcase_01 AC 73 ms
71,192 KB
testcase_02 AC 73 ms
71,424 KB
testcase_03 AC 73 ms
71,360 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1,193 ms
142,356 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 244 ms
86,952 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 103 ms
77,816 KB
testcase_15 WA -
testcase_16 AC 775 ms
118,312 KB
testcase_17 WA -
testcase_18 AC 102 ms
78,188 KB
testcase_19 WA -
testcase_20 AC 273 ms
88,832 KB
testcase_21 TLE -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 98 ms
77,824 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 TLE -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n,m,q = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(q)]

ab.sort(key=lambda x:(x[0],-x[1]))
lia = []
for a,b in ab:
    lia.append(b)

def LIS(L):
  from bisect import bisect
  seq = []
  for ai in L:
    pos = bisect(seq, ai)
    if len(seq) <= pos:
      seq.append(ai)
    else:
      seq[pos] = ai
  return len(seq)

print(LIS(lia))
0