結果

問題 No.1282 Display Elements
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-11-06 21:55:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 96,984 KB
最終ジャッジ日時 2023-09-29 18:40:36
合計ジャッジ時間 3,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,156 KB
testcase_01 AC 65 ms
71,412 KB
testcase_02 AC 64 ms
71,080 KB
testcase_03 AC 67 ms
71,424 KB
testcase_04 AC 72 ms
71,424 KB
testcase_05 AC 65 ms
71,504 KB
testcase_06 AC 67 ms
71,420 KB
testcase_07 AC 67 ms
71,424 KB
testcase_08 AC 65 ms
71,420 KB
testcase_09 AC 64 ms
71,428 KB
testcase_10 AC 71 ms
75,884 KB
testcase_11 AC 70 ms
75,948 KB
testcase_12 AC 68 ms
71,500 KB
testcase_13 AC 72 ms
75,352 KB
testcase_14 AC 74 ms
75,924 KB
testcase_15 AC 160 ms
95,436 KB
testcase_16 AC 107 ms
86,260 KB
testcase_17 AC 141 ms
95,484 KB
testcase_18 AC 116 ms
89,212 KB
testcase_19 AC 126 ms
95,916 KB
testcase_20 AC 122 ms
95,964 KB
testcase_21 AC 167 ms
96,984 KB
testcase_22 AC 151 ms
96,848 KB
testcase_23 AC 168 ms
96,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

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

ans = 0
for i, x in enumerate(b):
    p = bisect.bisect_right(a, x)
    
    if p < i:
        ans += n - i
    else:
        ans += n - p
print(ans)
0