結果

問題 No.2422 regisys?
ユーザー rlangevinrlangevin
提出日時 2023-09-03 16:45:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 1,159 ms
コンパイル使用メモリ 86,220 KB
実行使用メモリ 138,944 KB
最終ジャッジ日時 2023-09-03 16:46:21
合計ジャッジ時間 38,993 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,352 KB
testcase_01 AC 75 ms
70,916 KB
testcase_02 AC 75 ms
71,148 KB
testcase_03 WA -
testcase_04 AC 76 ms
71,276 KB
testcase_05 AC 78 ms
71,212 KB
testcase_06 WA -
testcase_07 AC 75 ms
71,016 KB
testcase_08 AC 76 ms
71,012 KB
testcase_09 AC 73 ms
71,296 KB
testcase_10 AC 74 ms
70,892 KB
testcase_11 WA -
testcase_12 AC 74 ms
71,388 KB
testcase_13 WA -
testcase_14 AC 73 ms
71,264 KB
testcase_15 WA -
testcase_16 AC 75 ms
71,268 KB
testcase_17 AC 72 ms
71,092 KB
testcase_18 AC 74 ms
70,868 KB
testcase_19 AC 74 ms
70,848 KB
testcase_20 WA -
testcase_21 AC 73 ms
71,376 KB
testcase_22 AC 75 ms
71,264 KB
testcase_23 AC 75 ms
71,344 KB
testcase_24 AC 75 ms
71,224 KB
testcase_25 AC 74 ms
71,104 KB
testcase_26 AC 73 ms
71,028 KB
testcase_27 AC 75 ms
71,356 KB
testcase_28 AC 73 ms
71,076 KB
testcase_29 AC 73 ms
71,156 KB
testcase_30 AC 74 ms
71,128 KB
testcase_31 AC 527 ms
98,564 KB
testcase_32 AC 635 ms
92,344 KB
testcase_33 AC 487 ms
99,244 KB
testcase_34 AC 209 ms
82,524 KB
testcase_35 AC 638 ms
109,820 KB
testcase_36 AC 353 ms
89,800 KB
testcase_37 AC 517 ms
97,540 KB
testcase_38 AC 293 ms
87,012 KB
testcase_39 AC 217 ms
83,348 KB
testcase_40 WA -
testcase_41 AC 254 ms
86,544 KB
testcase_42 AC 1,203 ms
118,800 KB
testcase_43 WA -
testcase_44 AC 1,158 ms
135,872 KB
testcase_45 WA -
testcase_46 AC 1,172 ms
136,336 KB
testcase_47 WA -
testcase_48 AC 1,351 ms
136,832 KB
testcase_49 WA -
testcase_50 AC 1,300 ms
138,944 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 1,500 ms
136,652 KB
testcase_55 AC 1,280 ms
135,868 KB
testcase_56 AC 740 ms
111,004 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 AC 67 ms
70,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = []
for i in range(N):
    D.append([A[i], B[i], 0])
L = [[-1], [-1]]
for i in range(M):
    T, C = map(int, input().split())
    L[T].append(C)
    
D.sort(reverse=True)
L[0].sort()
L[1].sort()
for i in range(N):
    if D[i][0] <= L[0][-1]:
        D[i][2] += 1
        L[0].pop()
        
for i in range(N):
    D[i][0], D[i][1] = D[i][1], D[i][0]
        
D.sort(reverse=True)
for i in range(N):
    if D[i][0] <= L[1][-1]:
        D[i][2] += 1
        L[1].pop()

ans = 0
cnt = 0
for i in range(N):
    if D[i][2] >= 1:
        cnt += D[i][2] - 1
        ans += 1
    else:
        if cnt:
            ans += 1
            cnt -= 1
print(N - ans)
0