結果

問題 No.1280 Beyond C
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-11-06 22:15:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 955 ms
コンパイル使用メモリ 86,536 KB
実行使用メモリ 97,208 KB
最終ジャッジ日時 2023-09-29 18:57:09
合計ジャッジ時間 4,057 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,240 KB
testcase_01 AC 62 ms
71,156 KB
testcase_02 AC 64 ms
71,520 KB
testcase_03 AC 62 ms
71,408 KB
testcase_04 AC 63 ms
71,408 KB
testcase_05 AC 62 ms
71,360 KB
testcase_06 AC 63 ms
71,212 KB
testcase_07 AC 61 ms
70,924 KB
testcase_08 AC 64 ms
71,220 KB
testcase_09 AC 69 ms
71,244 KB
testcase_10 AC 68 ms
71,404 KB
testcase_11 AC 77 ms
76,484 KB
testcase_12 AC 68 ms
71,392 KB
testcase_13 AC 72 ms
76,316 KB
testcase_14 AC 76 ms
76,384 KB
testcase_15 AC 128 ms
90,704 KB
testcase_16 AC 110 ms
87,784 KB
testcase_17 AC 122 ms
91,224 KB
testcase_18 AC 133 ms
96,040 KB
testcase_19 AC 132 ms
96,040 KB
testcase_20 AC 163 ms
97,208 KB
testcase_21 AC 165 ms
96,828 KB
testcase_22 AC 165 ms
97,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def bsearch(mn, mx, func):
    #func(i)=False を満たす最大のi (mn<=i<mx)
    idx = (mx + mn)//2
    while mx-mn>1:
        if func(idx):
            idx, mx = (idx + mn)//2, idx
            continue
        idx, mn = (idx + mx)//2, idx
    return idx
N, M, C = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
Y.sort()
b =R = 0
for x in X:
    i = bsearch(-1, M, lambda t: Y[t]*x > C)
    R += M-i-1
    b+=M
print(R/b)
0