結果

問題 No.1282 Display Elements
ユーザー c-yanc-yan
提出日時 2020-11-07 00:43:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 379 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 24,756 KB
最終ジャッジ日時 2023-09-29 19:52:59
合計ジャッジ時間 16,900 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,056 KB
testcase_01 AC 16 ms
7,944 KB
testcase_02 AC 15 ms
7,940 KB
testcase_03 AC 16 ms
7,944 KB
testcase_04 AC 16 ms
8,000 KB
testcase_05 AC 15 ms
8,088 KB
testcase_06 AC 15 ms
7,976 KB
testcase_07 AC 15 ms
8,100 KB
testcase_08 AC 15 ms
7,996 KB
testcase_09 AC 15 ms
7,996 KB
testcase_10 AC 25 ms
8,392 KB
testcase_11 AC 26 ms
7,956 KB
testcase_12 AC 15 ms
7,928 KB
testcase_13 AC 21 ms
8,068 KB
testcase_14 AC 31 ms
7,988 KB
testcase_15 AC 1,954 ms
22,068 KB
testcase_16 AC 782 ms
13,752 KB
testcase_17 AC 1,600 ms
19,640 KB
testcase_18 AC 975 ms
15,536 KB
testcase_19 AC 1,124 ms
24,756 KB
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a.sort()
t0 = []
t1 = []
result = 0
for i in range(N):
    c = a[i]
    t1.append(b[i])
    result += bisect_left(t0, c)
    result += sum(1 for b in t1 if b < c)
    if len(t1) == 1000:
        t0.extend(t1)
        t0.sort()
        t1 = []
print(result)
0