結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2021-09-25 01:28:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,614 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 84,172 KB
最終ジャッジ日時 2023-09-18 22:40:49
合計ジャッジ時間 61,070 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,075 ms
77,944 KB
testcase_01 AC 1,324 ms
80,528 KB
testcase_02 AC 1,465 ms
83,840 KB
testcase_03 AC 1,110 ms
77,692 KB
testcase_04 AC 978 ms
77,884 KB
testcase_05 AC 930 ms
77,876 KB
testcase_06 AC 995 ms
77,896 KB
testcase_07 AC 978 ms
77,772 KB
testcase_08 AC 885 ms
77,852 KB
testcase_09 AC 874 ms
78,264 KB
testcase_10 AC 881 ms
78,260 KB
testcase_11 AC 969 ms
78,236 KB
testcase_12 AC 969 ms
78,260 KB
testcase_13 AC 1,234 ms
78,124 KB
testcase_14 AC 1,390 ms
77,896 KB
testcase_15 AC 1,367 ms
78,084 KB
testcase_16 AC 1,299 ms
78,124 KB
testcase_17 AC 1,428 ms
78,028 KB
testcase_18 AC 1,011 ms
78,264 KB
testcase_19 AC 1,012 ms
78,596 KB
testcase_20 AC 1,019 ms
78,564 KB
testcase_21 AC 1,016 ms
78,188 KB
testcase_22 AC 1,001 ms
78,140 KB
testcase_23 AC 1,425 ms
80,620 KB
testcase_24 AC 1,407 ms
80,564 KB
testcase_25 AC 1,398 ms
80,584 KB
testcase_26 AC 1,399 ms
80,800 KB
testcase_27 AC 1,411 ms
80,648 KB
testcase_28 AC 1,348 ms
80,984 KB
testcase_29 AC 1,376 ms
80,248 KB
testcase_30 AC 1,371 ms
80,860 KB
testcase_31 AC 1,367 ms
80,024 KB
testcase_32 AC 1,372 ms
80,412 KB
testcase_33 AC 1,614 ms
83,764 KB
testcase_34 AC 1,593 ms
84,172 KB
testcase_35 AC 1,581 ms
83,188 KB
testcase_36 AC 1,585 ms
83,868 KB
testcase_37 AC 1,596 ms
83,908 KB
testcase_38 AC 1,552 ms
83,508 KB
testcase_39 AC 1,520 ms
83,448 KB
testcase_40 AC 1,532 ms
83,548 KB
testcase_41 AC 1,547 ms
83,524 KB
testcase_42 AC 1,523 ms
83,552 KB
testcase_43 AC 110 ms
76,884 KB
testcase_44 AC 1,017 ms
77,440 KB
testcase_45 AC 1,045 ms
77,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
import sys
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
readline=sys.stdin.readline

N=int(readline())
P=list(map(int,readline().split()))
Q=list(map(int,readline().split()))
for i in range(N):
    P[i]=[P[i]*Q[i]/100000,i]
    Q[i]/=100
_heapify_max(P)
ans=0
pro=1
for _ in range(10**6):
    p,i=_heappop_max(P)
    ans+=pro
    pro-=p
    _heappush_max(P,[p*(1-Q[i]),i])
print(ans)
0