結果

問題 No.210 探し物はどこですか?
ユーザー maspymaspy
提出日時 2020-03-20 00:26:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 511 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-05-08 03:35:21
合計ジャッジ時間 5,655 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 285 ms
10,880 KB
testcase_01 AC 1,413 ms
10,880 KB
testcase_02 TLE -
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 32 ms
11,008 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 32 ms
11,008 KB
testcase_07 AC 32 ms
11,008 KB
testcase_08 AC 44 ms
10,752 KB
testcase_09 AC 43 ms
10,624 KB
testcase_10 AC 42 ms
10,752 KB
testcase_11 AC 40 ms
10,752 KB
testcase_12 AC 39 ms
10,880 KB
testcase_13 AC 52 ms
10,880 KB
testcase_14 AC 41 ms
10,880 KB
testcase_15 AC 42 ms
10,880 KB
testcase_16 AC 41 ms
10,880 KB
testcase_17 AC 38 ms
11,008 KB
testcase_18 AC 175 ms
11,008 KB
testcase_19 AC 169 ms
10,880 KB
testcase_20 AC 168 ms
10,880 KB
testcase_21 AC 174 ms
10,752 KB
testcase_22 AC 170 ms
10,752 KB
testcase_23 AC 88 ms
11,008 KB
testcase_24 AC 75 ms
11,008 KB
testcase_25 AC 79 ms
10,880 KB
testcase_26 AC 83 ms
11,136 KB
testcase_27 AC 109 ms
11,008 KB
testcase_28 AC 771 ms
10,880 KB
testcase_29 AC 743 ms
10,752 KB
testcase_30 AC 776 ms
10,880 KB
testcase_31 AC 769 ms
10,752 KB
testcase_32 AC 757 ms
11,008 KB
testcase_33 AC 137 ms
11,008 KB
testcase_34 AC 135 ms
11,008 KB
testcase_35 AC 131 ms
11,136 KB
testcase_36 AC 151 ms
11,008 KB
testcase_37 AC 133 ms
11,008 KB
testcase_38 AC 1,325 ms
10,880 KB
testcase_39 AC 1,329 ms
10,880 KB
testcase_40 AC 1,375 ms
10,880 KB
testcase_41 AC 1,291 ms
11,136 KB
testcase_42 AC 1,358 ms
11,008 KB
testcase_43 AC 30 ms
10,880 KB
testcase_44 AC 31 ms
10,752 KB
testcase_45 AC 30 ms
11,008 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