結果

問題 No.1282 Display Elements
ユーザー O2MTO2MT
提出日時 2020-11-17 21:31:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 992 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 96,260 KB
最終ジャッジ日時 2023-09-30 14:27:42
合計ジャッジ時間 7,961 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,244 KB
testcase_01 AC 77 ms
71,364 KB
testcase_02 AC 76 ms
71,296 KB
testcase_03 AC 76 ms
71,236 KB
testcase_04 AC 74 ms
71,444 KB
testcase_05 AC 75 ms
71,248 KB
testcase_06 AC 75 ms
71,452 KB
testcase_07 AC 74 ms
71,084 KB
testcase_08 AC 73 ms
71,128 KB
testcase_09 AC 73 ms
71,056 KB
testcase_10 AC 82 ms
76,100 KB
testcase_11 AC 82 ms
75,852 KB
testcase_12 AC 77 ms
75,072 KB
testcase_13 AC 83 ms
75,228 KB
testcase_14 AC 84 ms
76,044 KB
testcase_15 AC 554 ms
95,024 KB
testcase_16 AC 197 ms
85,848 KB
testcase_17 AC 422 ms
95,012 KB
testcase_18 AC 244 ms
88,656 KB
testcase_19 AC 957 ms
95,800 KB
testcase_20 AC 992 ms
95,220 KB
testcase_21 AC 621 ms
96,032 KB
testcase_22 AC 624 ms
96,260 KB
testcase_23 AC 622 ms
95,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

A.sort()
que = []
count,k = 0,0
minB = B[0]

for i in range(N):
    j = bisect_left(que,B[i])
    que.insert(j,B[i])
    minB = min(B[i],minB)
    if A[k] > minB:
        count += bisect_left(que,A[k])
    k += 1

print(count)
0