結果

問題 No.210 探し物はどこですか?
ユーザー maspymaspy
提出日時 2020-03-20 00:26:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 553 ms / 2,000 ms
コード長 511 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 81,880 KB
実行使用メモリ 78,280 KB
最終ジャッジ日時 2024-05-08 03:35:01
合計ジャッジ時間 8,113 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
76,108 KB
testcase_01 AC 282 ms
76,500 KB
testcase_02 AC 553 ms
78,280 KB
testcase_03 AC 46 ms
59,416 KB
testcase_04 AC 58 ms
68,204 KB
testcase_05 AC 58 ms
70,524 KB
testcase_06 AC 41 ms
60,208 KB
testcase_07 AC 58 ms
69,052 KB
testcase_08 AC 64 ms
75,928 KB
testcase_09 AC 69 ms
75,740 KB
testcase_10 AC 65 ms
75,648 KB
testcase_11 AC 66 ms
75,924 KB
testcase_12 AC 67 ms
76,148 KB
testcase_13 AC 74 ms
76,300 KB
testcase_14 AC 68 ms
76,144 KB
testcase_15 AC 70 ms
75,920 KB
testcase_16 AC 66 ms
75,864 KB
testcase_17 AC 68 ms
75,880 KB
testcase_18 AC 102 ms
76,348 KB
testcase_19 AC 106 ms
76,188 KB
testcase_20 AC 105 ms
76,760 KB
testcase_21 AC 105 ms
76,244 KB
testcase_22 AC 100 ms
76,284 KB
testcase_23 AC 94 ms
76,404 KB
testcase_24 AC 89 ms
76,368 KB
testcase_25 AC 89 ms
76,072 KB
testcase_26 AC 93 ms
76,472 KB
testcase_27 AC 98 ms
76,544 KB
testcase_28 AC 241 ms
76,024 KB
testcase_29 AC 240 ms
76,296 KB
testcase_30 AC 247 ms
76,368 KB
testcase_31 AC 242 ms
76,344 KB
testcase_32 AC 235 ms
76,160 KB
testcase_33 AC 114 ms
76,540 KB
testcase_34 AC 111 ms
76,320 KB
testcase_35 AC 107 ms
76,432 KB
testcase_36 AC 113 ms
76,720 KB
testcase_37 AC 112 ms
76,436 KB
testcase_38 AC 379 ms
77,256 KB
testcase_39 AC 379 ms
77,256 KB
testcase_40 AC 401 ms
77,004 KB
testcase_41 AC 402 ms
77,592 KB
testcase_42 AC 422 ms
77,216 KB
testcase_43 AC 39 ms
52,492 KB
testcase_44 AC 37 ms
52,688 KB
testcase_45 AC 40 ms
53,352 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-9:
    n += 1
    x, q = hq[0]
    answer += n * (-x)
    S += x
    x *= (1 - q)
    heappushpop(hq, (x, q))

print(answer)
0