結果

問題 No.210 探し物はどこですか?
ユーザー maspymaspy
提出日時 2020-03-20 00:28:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 511 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-05-08 03:35:38
合計ジャッジ時間 15,051 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 207 ms
10,880 KB
testcase_01 AC 1,041 ms
10,752 KB
testcase_02 TLE -
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 31 ms
10,624 KB
testcase_05 AC 29 ms
10,752 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 29 ms
10,880 KB
testcase_08 AC 37 ms
10,752 KB
testcase_09 AC 37 ms
10,624 KB
testcase_10 AC 38 ms
10,624 KB
testcase_11 AC 34 ms
10,624 KB
testcase_12 AC 35 ms
10,624 KB
testcase_13 AC 42 ms
10,624 KB
testcase_14 AC 35 ms
10,752 KB
testcase_15 AC 35 ms
10,752 KB
testcase_16 AC 36 ms
10,752 KB
testcase_17 AC 34 ms
10,752 KB
testcase_18 AC 131 ms
10,752 KB
testcase_19 AC 134 ms
10,752 KB
testcase_20 AC 130 ms
10,752 KB
testcase_21 AC 135 ms
10,752 KB
testcase_22 AC 129 ms
10,752 KB
testcase_23 AC 68 ms
11,008 KB
testcase_24 AC 60 ms
10,880 KB
testcase_25 AC 60 ms
10,880 KB
testcase_26 AC 70 ms
11,008 KB
testcase_27 AC 87 ms
11,008 KB
testcase_28 AC 574 ms
10,752 KB
testcase_29 AC 553 ms
11,008 KB
testcase_30 AC 551 ms
10,880 KB
testcase_31 AC 588 ms
11,008 KB
testcase_32 AC 555 ms
10,624 KB
testcase_33 AC 106 ms
10,880 KB
testcase_34 AC 103 ms
11,008 KB
testcase_35 AC 97 ms
10,880 KB
testcase_36 AC 112 ms
10,880 KB
testcase_37 AC 105 ms
11,008 KB
testcase_38 AC 1,002 ms
11,008 KB
testcase_39 AC 1,016 ms
10,752 KB
testcase_40 AC 1,043 ms
10,752 KB
testcase_41 AC 1,015 ms
10,880 KB
testcase_42 AC 997 ms
10,752 KB
testcase_43 AC 27 ms
10,752 KB
testcase_44 AC 27 ms
10,880 KB
testcase_45 AC 27 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from heapq import heapify, heappushpop

N = int(readline())
P = [int(x) / 1000 for x in readline().split()]
Q = [int(x) / 100 for x in readline().split()]

hq = [(-p * q, q) for p, q in zip(P, Q)]
heapify(hq)

S = 1.0
n = 0
answer = 0
while S > 1e-7:
    n += 1
    x, q = hq[0]
    answer += n * (-x)
    S += x
    x *= (1 - q)
    heappushpop(hq, (x, q))

print(answer)
0