結果

問題 No.1282 Display Elements
ユーザー O2MTO2MT
提出日時 2020-11-17 21:31:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 345 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 23,328 KB
最終ジャッジ日時 2023-09-30 14:27:30
合計ジャッジ時間 13,274 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,940 KB
testcase_01 AC 15 ms
7,912 KB
testcase_02 AC 16 ms
8,080 KB
testcase_03 AC 16 ms
7,916 KB
testcase_04 AC 15 ms
8,012 KB
testcase_05 AC 16 ms
8,048 KB
testcase_06 AC 17 ms
8,032 KB
testcase_07 AC 16 ms
8,076 KB
testcase_08 AC 16 ms
7,968 KB
testcase_09 AC 16 ms
7,988 KB
testcase_10 AC 18 ms
8,008 KB
testcase_11 AC 18 ms
7,920 KB
testcase_12 AC 16 ms
8,108 KB
testcase_13 AC 17 ms
7,916 KB
testcase_14 AC 17 ms
7,960 KB
testcase_15 AC 1,221 ms
23,128 KB
testcase_16 AC 262 ms
13,808 KB
testcase_17 AC 879 ms
19,792 KB
testcase_18 AC 395 ms
15,160 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 1,415 ms
23,212 KB
testcase_22 AC 1,394 ms
23,140 KB
testcase_23 AC 1,423 ms
23,124 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