結果

問題 No.210 探し物はどこですか?
ユーザー maspymaspy
提出日時 2020-03-20 00:25:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,716 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 2,247 ms
コンパイル使用メモリ 86,564 KB
実行使用メモリ 84,696 KB
最終ジャッジ日時 2023-08-20 21:15:13
合計ジャッジ時間 17,668 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 220 ms
77,036 KB
testcase_01 AC 826 ms
78,888 KB
testcase_02 AC 1,716 ms
84,696 KB
testcase_03 AC 88 ms
75,200 KB
testcase_04 AC 106 ms
76,236 KB
testcase_05 AC 107 ms
76,928 KB
testcase_06 AC 87 ms
75,612 KB
testcase_07 AC 106 ms
76,484 KB
testcase_08 AC 110 ms
77,052 KB
testcase_09 AC 115 ms
77,152 KB
testcase_10 AC 115 ms
77,364 KB
testcase_11 AC 118 ms
77,192 KB
testcase_12 AC 118 ms
77,284 KB
testcase_13 AC 124 ms
77,244 KB
testcase_14 AC 118 ms
76,980 KB
testcase_15 AC 121 ms
77,180 KB
testcase_16 AC 117 ms
77,020 KB
testcase_17 AC 116 ms
77,208 KB
testcase_18 AC 192 ms
77,360 KB
testcase_19 AC 190 ms
77,300 KB
testcase_20 AC 183 ms
77,264 KB
testcase_21 AC 191 ms
76,988 KB
testcase_22 AC 190 ms
77,072 KB
testcase_23 AC 158 ms
77,332 KB
testcase_24 AC 143 ms
77,124 KB
testcase_25 AC 149 ms
77,404 KB
testcase_26 AC 153 ms
77,636 KB
testcase_27 AC 177 ms
77,128 KB
testcase_28 AC 575 ms
78,364 KB
testcase_29 AC 573 ms
78,268 KB
testcase_30 AC 564 ms
78,428 KB
testcase_31 AC 585 ms
78,592 KB
testcase_32 AC 577 ms
78,452 KB
testcase_33 AC 208 ms
77,708 KB
testcase_34 AC 198 ms
77,844 KB
testcase_35 AC 195 ms
77,484 KB
testcase_36 AC 211 ms
77,616 KB
testcase_37 AC 199 ms
77,740 KB
testcase_38 AC 971 ms
80,740 KB
testcase_39 AC 1,010 ms
80,936 KB
testcase_40 AC 1,024 ms
80,896 KB
testcase_41 AC 975 ms
80,684 KB
testcase_42 AC 990 ms
80,656 KB
testcase_43 AC 80 ms
71,328 KB
testcase_44 AC 79 ms
71,268 KB
testcase_45 AC 83 ms
71,160 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, p, q) for p, q in zip(P, Q)]
heapify(hq)

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