結果

問題 No.1280 Beyond C
ユーザー 👑 KazunKazun
提出日時 2020-11-06 21:29:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 798 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 96,148 KB
最終ジャッジ日時 2023-09-29 18:12:11
合計ジャッジ時間 3,655 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,044 KB
testcase_01 AC 65 ms
71,212 KB
testcase_02 AC 70 ms
71,576 KB
testcase_03 AC 67 ms
71,424 KB
testcase_04 AC 65 ms
71,440 KB
testcase_05 AC 66 ms
71,328 KB
testcase_06 AC 69 ms
71,452 KB
testcase_07 AC 68 ms
71,256 KB
testcase_08 AC 67 ms
71,632 KB
testcase_09 AC 68 ms
71,548 KB
testcase_10 AC 71 ms
71,380 KB
testcase_11 AC 78 ms
75,988 KB
testcase_12 AC 70 ms
71,424 KB
testcase_13 AC 74 ms
75,952 KB
testcase_14 AC 74 ms
76,420 KB
testcase_15 AC 121 ms
90,076 KB
testcase_16 AC 109 ms
88,580 KB
testcase_17 AC 122 ms
90,888 KB
testcase_18 AC 110 ms
94,876 KB
testcase_19 AC 128 ms
95,228 KB
testcase_20 AC 169 ms
95,992 KB
testcase_21 AC 168 ms
96,148 KB
testcase_22 AC 168 ms
95,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Binary_Search_Big_Count(A,x,equal=False,sort=False):
    """2分探索によって,xを超える要素の個数を調べる.

    A:リスト
    x:調べる要素
    sort:ソートをする必要があるかどうか(Trueで必要)
    equal:Trueのときはx"を超える"がx"以上"になる
    """

    if sort:
        A.sort()

    if A[-1]<x or ((not equal) and A[-1]==x):
        return 0

    L,R=-1,len(A)-1
    while R-L>1:
        C=L+(R-L)//2
        if A[C]>x or (equal and A[C]==x):
            R=C
        else:
            L=C
    return len(A)-R
#================================================
N,M,C=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
B.sort()

X=0
for a in A:
    X+=Binary_Search_Big_Count(B,C//a)

print(X/(N*M))
0