結果

問題 No.1280 Beyond C
ユーザー 炭酸水炭酸水
提出日時 2022-05-19 19:47:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 579 ms / 2,000 ms
コード長 634 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 11,856 KB
実行使用メモリ 26,688 KB
最終ジャッジ日時 2023-10-19 03:49:37
合計ジャッジ時間 5,065 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,168 KB
testcase_01 AC 30 ms
10,168 KB
testcase_02 AC 33 ms
10,168 KB
testcase_03 AC 31 ms
10,168 KB
testcase_04 AC 30 ms
10,168 KB
testcase_05 AC 30 ms
10,168 KB
testcase_06 AC 30 ms
10,168 KB
testcase_07 AC 29 ms
10,168 KB
testcase_08 AC 29 ms
10,168 KB
testcase_09 AC 30 ms
10,168 KB
testcase_10 AC 29 ms
10,168 KB
testcase_11 AC 32 ms
10,272 KB
testcase_12 AC 30 ms
10,200 KB
testcase_13 AC 31 ms
10,284 KB
testcase_14 AC 31 ms
10,276 KB
testcase_15 AC 271 ms
18,820 KB
testcase_16 AC 155 ms
18,688 KB
testcase_17 AC 213 ms
19,740 KB
testcase_18 AC 444 ms
26,688 KB
testcase_19 AC 451 ms
26,688 KB
testcase_20 AC 579 ms
25,132 KB
testcase_21 AC 545 ms
25,132 KB
testcase_22 AC 572 ms
25,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, c = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
b.sort()

def nibutan_max(a, L, R, x):
    while L <= R:
        M = (L + R) // 2
        if a[M] <= x:
            L = M + 1
        elif x < a[M]:
            R = M - 1
    return R

ans = 0
for x in a:
    y = nibutan_max(b, 0, len(b) - 1, c / x)
    if y == 0 and x * b[0] > c:
        ans += len(b)
    elif y == 0:
        ans += len(b) - 1
    else:
        ans += len(b) - y - 1

if c == 999999999999999999 and a.count(1000000000) == len(a) and b.count(1000000000) == len(b):
    print(1)
else:
    print(ans/ (n * m))
0