結果

問題 No.1280 Beyond C
ユーザー uni_pythonuni_python
提出日時 2020-11-06 23:42:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 99,020 KB
最終ジャッジ日時 2023-09-29 19:43:03
合計ジャッジ時間 3,734 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,532 KB
testcase_01 AC 69 ms
71,460 KB
testcase_02 AC 71 ms
71,152 KB
testcase_03 AC 67 ms
71,304 KB
testcase_04 AC 67 ms
71,136 KB
testcase_05 AC 69 ms
70,988 KB
testcase_06 AC 66 ms
71,328 KB
testcase_07 AC 66 ms
71,176 KB
testcase_08 AC 66 ms
71,536 KB
testcase_09 AC 67 ms
71,452 KB
testcase_10 AC 68 ms
71,100 KB
testcase_11 AC 78 ms
76,164 KB
testcase_12 AC 69 ms
71,336 KB
testcase_13 AC 74 ms
76,008 KB
testcase_14 AC 73 ms
76,012 KB
testcase_15 AC 131 ms
89,388 KB
testcase_16 AC 116 ms
88,076 KB
testcase_17 AC 129 ms
90,200 KB
testcase_18 AC 126 ms
95,760 KB
testcase_19 AC 129 ms
95,952 KB
testcase_20 AC 177 ms
98,856 KB
testcase_21 AC 170 ms
98,372 KB
testcase_22 AC 174 ms
99,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))


N,M,C=MI()
A=LI()
B=LI()
A.sort()
B.sort()

def count(a):
    # a*biがCを超えるようなbiの個数を求める
    ng=-1
    ok=M
    while ok-ng>1:
        med=(ok+ng)//2
        if B[med]*a>C:
            ok=med
        else:
            ng=med
    # print(a,M-ok)
    return M-ok

import bisect

ans=0
for i in range(N):
    a=A[i]
    ans+=count(a)


ans=ans/(N*M)

print(ans)
    
0